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

Re^4: How to read every 16 line of file ?

by bh_perl (Monk)
on May 13, 2011 at 04:04 UTC ( #904586=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to read every 16 line of file ?
in thread How to read every 16 line of file ?


This is my sample code to be execute but this is sample only..
#!/usr/bin/perl -w open (FILE, "/tmp/test.txt"); while ($line = <FILE>) { ... READ EVERY 16 LINE... } close(FILE);

Replies are listed 'Best First'.
Re^5: How to read every 16 line of file ?
by ikegami (Patriarch) on May 13, 2011 at 06:29 UTC
    You can't "read every 16th line", you can "do something with every 16th line", and I showed how already. Just replace "say" with whatever you want to do to the selected lines.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2022-08-16 03:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?