Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting one line at a time from a text file

Status
Not open for further replies.

cybercop23

IS-IT--Management
Aug 12, 2001
103
US
Hi everyone.
I have a text file of item numbers. I need to pull one line at a time and pass that to my shell script to process it. How can I pull first line, then 2nd, then third, until EOF?
I need to only get one line at a time and then move to the following line.

Sample file:
004124012725
004124012756
004124012856

Thanks for your help.
AB
 
while read f
do echo "item#=$f"
done < /path/to/file

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It's that easy. Thanks much for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top