![]() |
|
No such thing as a small change | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
perl -ne 'if ( ++$x == 16 ){ print $_; $x = 0; }' <filename
Update: but only if the rest of the logic is simple enough for inclusion in a one-liner like this. update2: modified to shift target line nos to 16,32 etc. - a weird brainbug made me think 1,17 etc. was wanted - I need a holiday, lol! One world, one people In reply to Re: How to read every 16 line of file ?
by anonymized user 468275
|
|