Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by avanta (Beadle)
on Nov 24, 2010 at 03:32 UTC ( #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? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-03-26 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?