perl -pe"BEGIN{<>} chomp if $.%2==0"
Reads from STDIN or from the file provided as an argument.
>type data Line 1: Header Line 2: Keep me! Line 3: Join me to the previous line. Line 4: Keep me! Line 5: Join me to the previous line. Line 6: Keep me! Line 7: Join me to the previous line. Line 8: Keep me! Line 9: Join me to the previous line. >perl -pe"BEGIN{<>} chomp if $. % 2 == 0" data Line 2: Keep me!Line 3: Join me to the previous line. Line 4: Keep me!Line 5: Join me to the previous line. Line 6: Keep me!Line 7: Join me to the previous line. Line 8: Keep me!Line 9: Join me to the previous line.
In reply to Re: When every 2 lines of a file (sans first) should be 1...
by ikegami
in thread When every 2 lines of a file (sans first) should be 1...
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |