I have two files, data.txtand results.txtif data.txtthere are 5 lines in it, I want to copy all these lines and paste them into the file results.txt, starting with line number 4 .
The following is an example:
Data.txt File:
stack
ping
dns
ip
remote
Results.txt file:
this is the 4th line that data should go on.
I tried sedwith various combinations, but I could not get it to work, I am not sure if it is suitable for this purpose.
sed -n '4p' /path/to/file/data.txt > /path/to/file/results.txt
The above code only copies line 4. This is not what I'm trying to achieve. As I said above, I need to copy all the lines from data.txtand paste them in results.txt, but it should start at line 4 without changing or overriding the first three lines.
Any help is greatly appreciated.
EDIT:
, 4 results.txt. , 3 data.txt.