Computing.Net > Forums > Linux > extracting data from ascii files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

extracting data from ascii files

Reply to Message Icon

Name: gavram
Date: January 18, 2008 at 06:37:07 Pacific
OS: linux/fedora
CPU/Ram: ?
Product: dell
Comment:

i have ~100 data files which contain ~10000 rows - the files are slightly different size. each row contains various data values including a unique number (id) in column x which identifies the source which the data refers to. I want to extract a whole row if id= a specific number. i then want to do that for all 100 files to get a file which gives all the data for that id. any idea how i do this using a combination of, say, cshell, awk and sed commands?

many thanks
gav




Sponsored Link
Ads by Google

Response Number 1
Name: jefro
Date: January 18, 2008 at 15:37:21 Pacific
Reply:

When I have to do that I try to write it down in plain words such as you have above and then try to break it down in parts. I then use those parts for the commands.

Important parts of what you said.

Be sure you know your shell be it bash or what not.

-from files (or create file that contains all the file names if you wish.)
-ascii
-search each line using delimiter.
Save delimiter in holding area of like
delimiter being id= if changes.
-take line to some working area or even the final file.


I could do it maybe but it sounds like too much work.

I read it wrong and answer it wrong too. So get off my case you peanut.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: extracting data from ascii files

cron job and extended ascii files www.computing.net/answers/linux/cron-job-and-extended-ascii-files/20965.html

Huge ASCII file, please help! www.computing.net/answers/linux/huge-ascii-file-please-help/14517.html

How to read 1 line from text file www.computing.net/answers/linux/how-to-read-1-line-from-text-file/15725.html