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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

line version of seek

Status
Not open for further replies.

liv4jc

Programmer
May 10, 2002
6
0
0
CA
Is there a version of seek that counts by line instead of by character? For example, I want to be able to type:

seek(FILE, 3, 0);

and be at the 3rd line of the file. Is that possible?

Thanks.
 
Code:
$count = 0;
...
while (<FILE>)
 &action if ($count == 2)
 $count++
}

# or u can still use a @array to file $thirdline = $array[2]
---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top