I have one base file, and multiple target files-- each have uniform line structure so no need to use grep to find things-- can just define sections by line number.
My question is quite simple-- can I use sed to copy a defined block of lines (say lines 5-10) from filename1.txt to overwrite an equally sized block of lines (lines 25-30) in filename2.txt.
Put another way, I have file1.txt that looks like:
AAAA
BBBB
1111
2222
3333
CCCC
and want to copy the lines with numbers into similarly formatted lines with numbers in file 2 (but not with matching starting line numbers).
DDDD
EEEE
FFFF
GGGG
4444
5555
6666
HHHH
IIII
JJJJ
I have been able to do this within an individual file, but haven't been able to bridge the two.