OK, so for a grand overview of what I'm trying to do:
I've got 2 files that are mostly like.
The file format is:
[descriptor1]
data
data
data
data
[descriptor2]
data
data
data
data
[descriptor3]
data
data
[descriptor4]
data
data
OK, so what I need to do is take all data from [descriptor2] and [descriptor3] sections from file1, remove like sections from file2, and then insert the stream from file1 in the right spot in file2. Fun, right?
Well, I'm new w/
sed, but that seems the best way to do this (correct me if I'm wrong). I've got some code that's working atm, however it's giving me the actual line [descriptor4] as that's the end of the range I'm using and I don't want it to include that in the section delete, how do I not make it do that?
sed '/\[descriptor2/,/\[descriptor4/!d' file1
Basically, I want the output to be:
[descriptor2]
data
data
data
data
[descriptor3]
data
data
And it's giving me all that, plus a [descriptor4] as that's where the range ends, but I'm not sure how else to define it.
Thank you for any light you can shed!