Extract only specific part from a file
Hello All,
I would like to know if there is a better way to achieve the below task:
Task: Copy lines 10 to 50 from a files that contains 100 lines.
My approach:
1st) use head command and then list first 50 lines and then tail last 40 lines.
2nd) Do a while loop with a counter and then when counter reaches to 10 start writing it to another file up to the point where the counter is 50 and then exit.
I would like to know if there are any other simple and straight approach using which I can directly copy lines 10 to 50.
Help and suggestions on this question are greatly appreciated.
Thanks.
|