I want to replace 5 rows of text in a file with the text of another file in my script, I know that running vim I can do
:45,50d
:r replacement.txt
to delete 5 rows and then insert the entire file, but I want to know if it's possible to do this from a script & how? I've searched high & low and cannot find any clue how to do something like this.
sed
could do multi-line, or replace with text from a file, I've only ever seen it with regex, could you give an example?