Computing.Net > Forums > Programming > Reading contents of a unix file separated by

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.

Reading contents of a unix file separated by

Reply to Message Icon

Name: Akshay Viswanathan
Date: May 26, 2009 at 02:10:56 Pacific
OS: Macintosh
Subcategory: Theory
Comment:

i want to read a txt file which contains a product
id(numeric) and the product name(alphanumeric)
separated by delimiter. i want to extract both into
separate variables. how do i do it using shell script?



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: May 26, 2009 at 03:28:54 Pacific
Reply:

use awk

awk -F"|" '{
   print $1,$2
}
' file


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 Programming Forum Home


Sponsored links

Ads by Google


Results for: Reading contents of a unix file separated by

i wanted to delete the content of a text file www.computing.net/answers/programming/i-wanted-to-delete-the-content-of-a-text-file/19673.html

Read,seach and write a binary file? www.computing.net/answers/programming/readseach-and-write-a-binary-file/7204.html

Batch, get folder of a found file www.computing.net/answers/programming/batch-get-folder-of-a-found-file/16126.html