multi-line sed example

Aug 1, 10:30 AM

problem:


these tags should NEVER appear together like this

solution:

sed -e “//{N;s/\n//;}” x.html

// – look for the tag

{ – start grouping next command
N; – store this line in into the buffer and get the next line
s/\n// – look for two tags separated by newline, and REPLACE with just one tag
; – terminate command
} – end grouping for this command

Mark Edwards

,

---

Commenting is closed for this article.

---