It would IF I knew what you were doing! :-)

I guess it adds surrounding newlines to the start and end content tags,
then extracting everything between them in the final stage of the
pipeline. Is that 2 patterns seperated by a comma? Not seen that trick b4.

However, it left the <content> tags in the output, but I can filter them
with grep -v now.

Ta,
Ed



Robert Citek wrote:

>
> 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/


-- 
Ed Howland
WDT Solutions, LLC.
[EMAIL PROTECTED]
(314) 962-0766

 
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to