in reply to Re: extract (a range of) numbered lines from a file -- smarter oneliner 27chars
in thread extract (a range of) numbered lines from a file
Nice!
perl -e "print +(0,<ARGV>)[eval pop]" linenumber.txt 1,3..5
You can omit the ARGV, and the blank after print, too:
perl -e "print+(0,<>)[eval pop]" linenumber.txt 1,3..5
22 :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: extract (a range of) numbered lines from a file -- let's say 20 char oneliner
by Discipulus (Canon) on Sep 21, 2016 at 20:27 UTC |