The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
reading ps command's output line by line s. murat Shell Programming and Scripting 5 05-22-2008 01:23 AM
Reading the particular line from the file eamani_sun Shell Programming and Scripting 3 05-16-2008 01:55 PM
reading text file line by line MizzGail Shell Programming and Scripting 6 04-14-2008 03:58 AM
Line by line file reading... and more! ProFiction Shell Programming and Scripting 6 07-26-2007 08:32 AM
Reading line by line from file. akpopa UNIX for Dummies Questions & Answers 4 08-30-2001 07:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-22-2006
Registered User
 

Join Date: Jan 2006
Location: Gandhinagar, India
Posts: 25
Reading line by line from a file

Hello..

Is there any way in UNIX shell scripting by which we can read a file one line at a time and at the same time maintains a count of where to read the next line from?

i could not find any such command and so i am currently using something like

head -$COUNTER | tail -1
COUNTER=`expr $COUNTER + 1`

to read successive lines..

bye
Reply With Quote
Forum Sponsor
  #2  
Old 01-22-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
See this - 12 Ways to Parse a file
Reply With Quote
  #3  
Old 01-22-2006
Registered User
 

Join Date: Jan 2006
Location: Gandhinagar, India
Posts: 25
well thanks a lot...

i will go through that....
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0