i am guessing that old.xml is source and new is supposed to be created with these changes? if so add > new.xml at the end
Code:
sed 's:</pagenum>:&</p>:g' old.xml
such expression works - 100% confirmed
Code:
$ echo '</pagenum> </pagenum>' | sed 's:</pagenum>:&</p>:g'
</pagenum></p> </pagenum></p>
1st char after s defines a separator so you don't have to use / and escape it later, just pick something that is not used anywhere in your pattern
& = part matching the pattern
g at the end tells sed to replace all occurences, not only first
Bookmarks