Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: how to read every 10 line from input text file ?

by avanta (Beadle)
on Nov 24, 2010 at 03:32 UTC ( [id://873356]=note: print w/replies, xml ) Need Help??


in reply to Re: how to read every 10 line from input text file ?
in thread how to read every 10 line from input text file ?


"toolic" code will make it sleep at 10th line but if u need to read every 10th line following is the modified code
open (FILE,"file.txt"); while (my $data = <FILE>) { if($. % 10 ==0) { chomp($data); print ("$data\n"); sleep 60; } } close(FILE);
Thanks
AvantA

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://873356]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-20 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found