Hi everyone,
I have a file that contains a list of descriptions. Here are the first four of them as an example:
<Topic r:id="Stuff/EnglishA">
Stuff here A1
Stuff here A2
Stuff here A3
Stuff here A4
Stuff here A5
</Topic>
<Topic r:id="Stuff/Not_English1">
Stuff here Not1_1
Stuff here Not1_2
Stuff here Not1_3
</Topic>
<Topic r:id="Stuff/EnglishB">
Stuff here B1
Stuff here B2
Stuff here B3
Stuff here B4
</Topic>
<Topic r:id="Stuff/Not_English2">
Stuff here Not2_1
Stuff here Not2_2
</Topic>
What I want to do is to create another file that contains only the descriptions that have a particular topic. For example, I want one file that contains only topics where the first line begins with "<Topic r:id="Stuff/English":
<Topic r:id="Stuff/EnglishA">
Stuff here A1
Stuff here A2
Stuff here A3
Stuff here A4
Stuff here A5
</Topic>
<Topic r:id="Stuff/EnglishB">
Stuff here B1
Stuff here B2
Stuff here B3
Stuff here B4
</Topic>
I have strugled with various sed, awk and perl commands but just haven't got it yet.
Could anyone with a big heart save me please?