Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Delete every n lineby mr_mischief (Monsignor) |
on May 09, 2008 at 15:05 UTC ( [id://685694]=note: print w/replies, xml ) | Need Help?? |
b10m has a good solution based on a common Unix tool (that's available for other platforms, but not as common on them), but how about a Perl solution?
Here's a one-liner you can use from the command line:
Here's a somewhat clearer version:
Or one that accepts an argument for which lines to remove:
Please remember that if this is a homework assignment, it's proper form to say so. Asking for completed work instead of help when it's a school assignment doesn't do any good in the long run and isn't fair to students who actually did the work.
In Section
Seekers of Perl Wisdom
|
|