On Aug 31, 2005, at 11:31 AM, Ed Howland wrote:
Shorter file:
<root>
<inner1>
<content>A bunch of tesxt and <strong>fragmented</strong> HTML stuff
with possible embedded
newlines here<br></content>
</inner1>
</root>
egrep -v works great in the former case. What can help me in the
general
case to pull unchanged everything from
the <content> </content> tags regardless of lines? I don't think sed
will work, and Awk looks tricky.
Would this work?
{ cat <<"EOF"
<root>
<inner1>
<content>A bunch of tesxt and <strong>fragmented</strong> HTML stuff
with possible embedded
newlines here<br></content>
</inner1>
</root>
EOF
} |
sed -e 's/<content>/\n<content>\n/g' -e 's/<\/content>/\n<\/content>
\n/g' |
sed -n '/<content>/,/<\/content>/p'
Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software. Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/