[ACCEPTED]-Copy/Paste part of a file into another file using Terminal (or Shell)-copy-paste
Accepted answer
if you know how many lines are in your source 6 file (wc -l) you can do this .. assume 12000 5 lines and you want lines 2000 - 7000 in 4 your new file (total of 5000 lines).
cat 3 myfile | tail -10000 | head -5000 > newfile
Read 2 the last 10k lines, then read the 1st 5k 1 lines from that.
sed
command should work fine, replace double 1 quotes with single quotes.
sed -n '1000, 1000000p' path/first/file > path/second/file
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.