Re: How to count lines in an output file

2002-02-19 Thread Tim Lago
thanks for everyones help, it worked great. "Tim Lago" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I've written a really simple script that opens a file, reads for specific > line of text and copies the matches to an output file, > > Here it is: > > open(IN

RE: How to count lines in an output file

2002-02-19 Thread Timothy Johnson
I guess I should have checked the responses first. Well, I guess if there was any doubt... :) -Original Message- From: Timothy Johnson To: 'Tim Lago '; [EMAIL PROTECTED] Sent: 2/19/02 8:12 AM Subject: RE: How to count lines in an output file You could always try something

RE: How to count lines in an output file

2002-02-19 Thread Timothy Johnson
You could always try something like this: while() { if(/$realname/) { print OUTFILE; $count++; } } $count should have the number of lines at the end. -Original Message- From: Tim Lago To: [EMAIL PROTECTED] Sent: 2/19/02 6:30 AM Subject: How to count lines in an output file I'

Re: How to count lines in an output file

2002-02-19 Thread Geoffrey F. Green
See below: On 2/19/02 9:30 AM, "Tim Lago" <[EMAIL PROTECTED]> wrote: > open(INFILE, "rmaccess1.txt"); > open(OUTFILE, ">outfile.txt"); > > print "Enter the name of the Media file to analyze and press Enter: \n"; > > chomp($realname = ); my $count; > while() { > > if(/$realname/) { > print

RE: How to count lines in an output file

2002-02-19 Thread John Edwards
open(INFILE, "rmaccess1.txt") or die "Can't open rmaccess1.txt: $!"; open(OUTFILE, ">outfile.txt") or die "Can't create outfile.txt: $!"; # ALWAYS check for errors when opening file handles. It's a good habit to get into. print "Enter name of the Media file to analyse: "; # I'd keep the above on

RE: How to count lines in an output file

2002-02-19 Thread Tony McGuinness
-Original Message- From: Tim Lago [mailto:[EMAIL PROTECTED]] Sent: 19 February 2002 14:31 To: [EMAIL PROTECTED] Subject: How to count lines in an output file I've written a really simple script that opens a file, reads for specific line of text and copies the matches to an output file,