It is possible to use command line sed to easily extract a range of lines from a text file. The command to be used is:
the numbers indicate the range of lines to make the following command operate on;
the command
References:
http://stackoverflow.com/questions/83329/how-can-i-extract-a-range-of-lines-from-a-text-file-on-unix
sed -n 16224,16482p filename > newfile
Where 16224,16482 are the start line number and end line number, inclusive. This is 1-indexed.
-n
suppresses echoing the input as output, which you clearly don't want; the numbers indicate the range of lines to make the following command operate on;
the command
p
prints out the relevant lines.References:
http://stackoverflow.com/questions/83329/how-can-i-extract-a-range-of-lines-from-a-text-file-on-unix
No comments:
Post a Comment