-----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,
Here it is:
open(INFILE, "rmaccess1.txt");
open(OUTFILE, ">outfile.txt");
print "Enter the name of the Media file to analyze and press Enter: \n";
chomp($realname = <STDIN>);
while(<INFILE>) {
if(/$realname/) {
print OUTFILE;
$count++;
}
}
Now, I want to add another line that counts the number of lines that were
created in the outfile.txt, any help?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
=====================================================================
DISCLAIMER
1. The information contained in this E-mail is confidential.
It is intended only for the stated addressee(s) and access
to it by any other person is unauthorised.
If you are not an addressee, you must not disclose, copy,
circulate or in any other way use or rely on the information
contained in this E-mail. Such unauthorised use may be unlawful.
If you have received this E-mail in error, please inform us
immediately and delete it and all copies from your system.
2. The views expressed in this E-mail are those of the author,
and do not represent the views of AMT-Sybex Group Ltd., its
associates or subsidiaries, unless otherwise expressly indicated.
In the avoidance of doubt, the insertion of the name of AMT-Sybex
Group Ltd., its associate or subsidiary under the name of the sender
may constitute an express indication that the views stated in the Mail
are those of the named company.
=====================================================================
For more information on the AMT Sybex group visit: http://www.amt-sybex.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]