Reading a particular line from a file

2007-06-20 Thread Nath, Alok (STSD)
Hi, Is it possible to read a particular line by line number ? For e.g reading line 3 from a file. I don't want to read each line and count. Thanks Alok -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Reading a particular line from a file

2007-06-20 Thread Ken Foskey
On Wed, 2007-06-20 at 17:12 +0530, Nath, Alok (STSD) wrote: Hi, Is it possible to read a particular line by line number ? For e.g reading line 3 from a file. I don't want to read each line and count. No and yes. If it is genuine new random data then no. If it is fixed

Re: Reading a particular line from a file

2007-06-20 Thread Paul Lalli
On Jun 20, 7:42 am, [EMAIL PROTECTED] (Alok Nath) wrote: Is it possible to read a particular line by line number ? For e.g reading line 3 from a file. I don't want to read each line and count. You don't have to count. Perl counts for you. The current line number is

Re: Reading a particular line from a file

2007-06-20 Thread todeepaksahoo
On 20 Jun, 16:42, [EMAIL PROTECTED] (Alok Nath) wrote: Hi, Is it possible to read a particular line by line number ? For e.g reading line 3 from a file. I don't want to read each line and count. Thanks Alok You can do below to print the 3rd line. open FILE, ./xyz

RE: Reading a particular line from a file

2007-06-20 Thread Andrew Curry
But that still reads the entire file to that point, You can use seek if you know the number of chars on a line. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 13:53 To: beginners@perl.org Subject: Re: Reading a particular line from a file On 20

Re: Reading a particular line from a file

2007-06-20 Thread Mumia W.
On 06/20/2007 06:42 AM, Nath, Alok (STSD) wrote: Hi, Is it possible to read a particular line by line number ? For e.g reading line 3 from a file. I don't want to read each line and count. Thanks Alok The module Tie::File makes this easy. However, you should