星期三, 5月 30, 2018

extract line number between n1 and n2 from a text file

awk:

awk '{if ((NR > n1) && (NR < n2)) print $0}' text_file_name

perl:

perl -ne 'print n1..n2' text_file_name

沒有留言: