perl -ne 'print if $. >= 17 && $. <= 30' infile.txt > output.txt