Skip to content

Instantly share code, notes, and snippets.

@jamesshipton
Created June 1, 2011 16:40
Show Gist options
  • Save jamesshipton/1002716 to your computer and use it in GitHub Desktop.
Save jamesshipton/1002716 to your computer and use it in GitHub Desktop.
sed - to amend multiple lines
cat changeset.xml | sed '/<cs:removal>/ {
N
s|<cs:removal>\n|<cs:removal>|
N
s|</rdf:Statement>\n|</rdf:Statement>|
}' | sed 's|<cs:removal>.*</cs:removal>||' > changeset_addition.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment