Last active
November 1, 2025 12:42
-
-
Save dex4er/98a58f0f60f12db1901866c4d9a4910c to your computer and use it in GitHub Desktop.
Print by N pages, first even then odd pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| perl -le '$pages=3; $start=7; $end=104; for $a (0..$end-$start) { push @even, $a+$start if $a % ($pages*2) < $pages; push @odd, $a+$start if $a % ($pages*2) >= $pages }; for $a (0..(length @even)-1) { print join ",", grep {defined} @even[(0+$a*$pages*10)..(($pages*10-1)+$a*$pages*10)]; }; print; for $a (0..(length @odd)-1) { print join ",", grep {defined} @odd[(0+$a*$pages*10)..(($pages*10-1)+$a*$pages*10)]; }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment