The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

sed help by imrambi 2009-04-10 11:05:27
I'm looking to remove text between a set of tags in xml including the tags. The beginning tag will not be on its own line, and the ending tag will be on a different line, then followed by another opening tag.

Example:
...
</tag1><tag id="name">
<xml data>
<xml data>
</tag><tag2>
...

The tag id="name" is unique, but name might not be. After the sed command, I want the output to be:

</tag1>
<tag2>

or

</tag1><tag2>

Either one is fine by me. This is one Windows using tools in Msys.
[ Reply ]
  Can I use awk rather than sed? by AndyA2009-04-10 11:25:44
    I can use gawk by imrambi2009-04-10 11:57:26
      Can you post the section of the actual file? by AndyA2009-04-10 12:01:44
        Slight refinement... by AndyA2009-04-10 12:15:05
          Thanks! by imrambi2009-04-10 12:30:27
  I think awk may be a more appropriate tool for by vampire2009-04-10 11:26:50
    Or just do it all in awk ;-) (n/t) by AndyA2009-04-10 11:29:47

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)