Computing.Net > Forums > Unix > reading from a file in unix

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 from a file in unix

Reply to Message Icon

Name: trichyselva
Date: March 27, 2006 at 21:50:13 Pacific
OS: win xp
CPU/Ram: p4
Product: pentium
Comment:

how to read from a file line by line in unix



Sponsored Link
Ads by Google

Response Number 1
Name: lchi2000g
Date: March 29, 2006 at 11:31:29 Pacific
Reply:

cat input.txt | while read LINE
do
echo $LINE
done

Luke Chi


1

Response Number 2
Name: Lance Cheng
Date: May 16, 2006 at 22:35:37 Pacific
Reply:

I have a question.. what if you have a file having numbers every line and you have to get the total of all the numbers in the file? How will you do that?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


num not identified when u... replace characters in str...



Post Locked

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


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: reading from a file in unix

Reading from a file www.computing.net/answers/unix/reading-from-a-file/7007.html

input to a program from a file www.computing.net/answers/unix/input-to-a-program-from-a-file/5021.html

update the contents of a file in Un www.computing.net/answers/unix/update-the-contents-of-a-file-in-un/5963.html