LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-26-2015, 10:21 AM   #16
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,610
Blog Entries: 12

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962

Quote:
Originally Posted by shazo View Post
i read first entity seperetly for each file i wanted to now simple comand to do this because i have many files. anyways thanks alot for all your help.
Thank you for showing where you are on this effort, that really does help a lot.

In description, also because I'll have to experiment a bit to get it right unless someone else has either a better idea or the next level of answer:

I would use a BASH script which matches what you're doing, command line actions.
I would put the list of files into an array and work at figuring out how to fill that array via automatic means, but initially I may just type it in.
Then you could use each element of that array and a loop to make a results array.
Code:
#!/bin/sh

FILE_LIST=('file1.txt' 'file2.txt' 'file3.txt');
And then there are notations to determine the size of that array, even though you know it, you can have one which you don't know the size, hence the notation to obtain the size. Further there are notations to get an element per index, and so forth. I'm just not really strong on BASH arrays, and would recommend you search the web for some examples, that's what I do when I run into a specific notation issue I'm weak on. Here's one resource: http://www.thegeekstuff.com/2010/06/...rray-tutorial/.
 
1 members found this post helpful.
Old 01-27-2015, 08:03 AM   #17
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,529

Rep: Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896
As indicated, a simple loop around your read has captured your solution, but as awk was mentioned, this would be simpler still:
Code:
awk 'FNR==1{print $1}' file*
 
1 members found this post helpful.
Old 01-27-2015, 04:29 PM   #18
shazo
LQ Newbie
 
Registered: Dec 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks a lot!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I select all files except a group? fpp666 Programming 3 07-16-2009 07:31 AM
in copy files or ls files the command want to invert select some files how to?? hocheetiong Linux - Newbie 3 06-27-2008 06:32 AM
SuSE 9.3-You can only select local files bmk SUSE / openSUSE 8 09-08-2005 05:08 PM
GtkFileChooserDialog: How to select both, files and directories? froedi Programming 0 06-11-2005 07:07 AM
select files with attributes Quis Linux - General 1 04-03-2003 02:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration