The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 04:23 AM
Reading the particular line from the file eamani_sun Shell Programming and Scripting 3 05-16-2008 04:55 PM
reading text file line by line MizzGail Shell Programming and Scripting 6 04-14-2008 06:58 AM
Line by line file reading... and more! ProFiction Shell Programming and Scripting 6 07-26-2007 11:32 AM
Reading line by line from file. akpopa UNIX for Dummies Questions & Answers 4 08-30-2001 10:20 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-23-2006
tej.buch tej.buch is offline
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
  #2 (permalink)  
Old 01-23-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
See this - 12 Ways to Parse a file
  #3 (permalink)  
Old 01-23-2006
tej.buch tej.buch is offline
Registered User
  
 

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

i will go through that....
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0