awk --> selective printout with FNR

Hi everybody!

need some awk-support. i want a line-selective printout of a file.
wat i normally will do with ...

awk ' FNR==8' sample.txt

But now i need the data from line 8, 10 and the following data from line13 to 250 wich is not end of the file. I tried allready to combine it but without success. can someone please give me a hint.

thanks in advance,
IMPe

What have you tried?

awk 'FNR==8 || FNR==10 || (FNR>=13 && FNR<=250)' sample.txt

should work.

1 Like

baaam, that works propper!
Thanks a lot CarloM