I told you my 'nix was rusty... ;-)
"Gary Stainburn" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi folks,
>
>
> On Wednesday 19 Feb 2003 9:15 am, Lance wrote:
> > On a Unix system you could use 'lc' to count the lines and 'top' or
'tail'
> > to read the fir
Hi folks,
On Wednesday 19 Feb 2003 9:15 am, Lance wrote:
> On a Unix system you could use 'lc' to count the lines and 'top' or 'tail'
> to read the first or last lines. My Unix is getting rusty, but there are
> functions to do what you want - so you could do something like:
>
> my $linecount = `
On a Unix system you could use 'lc' to count the lines and 'top' or 'tail'
to read the first or last lines. My Unix is getting rusty, but there are
functions to do what you want - so you could do something like:
my $linecount = `cat file.txt| lc`;
to get the line count. I'm sure that the lc comm
> > Subject: How to get 1st line, last line and no of lines in a file
> > is there any perl functions available for that ?
> > suppose, if file have millions of records,
ok
If it's a small file, try Tie::File by (I believe) Mark Jason Dominus.
It's very cool.
For a big file, I'm not sure ther
Madhu Reddy wrote:
> Hi,
>How to get first line, last line and no of lines in
> a file.
>
> is there any perl functions available for that ?
> right now what i am doing is
>
> open file
> while (
> {
> $lines++;
> }
> close(FH)
>
> This operation is expensive..
> suppose, if file have mil
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 19, 2003 1:25 PM
> To: [EMAIL PROTECTED]
> Subject: How to get 1st line, last line and no of lines in a file
>
>
> Hi,
>How to get first line, last line and no of lines in
> a file.
>