in reply to Re^4: extract (a range of) numbered lines from a file
in thread extract (a range of) numbered lines from a file

There are no empty lines in your input.
21:30 choroba@still ~ $ perl -E 'say "\n", 2 * $_ for 1 .. 10' | sed - +ne '10,15p;5p' 10 12 14 21:31 choroba@still ~ $ perl -E 'say "\n", 2 * $_ for 1 .. 10' | sed - +ne '/^$/d;10,15p;5p' 10 12 14 21:31 choroba@still ~ $ type sed sed is /bin/sed 21:31 choroba@still ~ $ rpm -q sed sed-4.2.2-5.1.2.x86_64

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^6: extract (a range of) numbered lines from a file
by shmem (Chancellor) on Sep 21, 2016 at 19:40 UTC
    There are no empty lines in your input.

    Ah, I see now. Eliminating empty lines was not a requirement, although the OP wasn't clear about that, since the convoluted sed | awk construct in fact did remove all empty lines, even those wanted. The perl script doesn't, however. The sed | awk was there for illustration purposes alone.

    The l script is meant to include empty lines of input. Sorry for the unclear spec.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'