CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [diemaker] General Q about regex matches VI vs. Perl: Edit Log



KevinR
Veteran


Sep 28, 2003, 9:51 PM


Views: 6678
Re: [diemaker] General Q about regex matches VI vs. Perl

this should work to do what you want for a text file:


Code
 open (FILE, "path/to/your/text_file");  
$count = 0;
while ( <FILE>) {
$count++ if (/\w\n/);
}
close (FILE);

print $count;

and with that I bid you good luck and goodnight Smile
-------------------------------------------------


(This post was edited by KevinR on Sep 28, 2003, 9:54 PM)


Edit Log:
Post edited by KevinR (Veteran) on Sep 28, 2003, 9:54 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives