Need help with SED command to remove text
Hi Again,
I got stuck again with SED and I need a lil' help. I have the following file named y.xml Code:
<?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0"> <channel> <title>News</title> <lastBuildDate>Tue, 21 Jul 2009 16:32:47 Asia/Singapore</lastBuildDate><art>201002041656400001"> Code:
</channel></rss> Code:
sed -n '/</channel></rss>/,/</art><aut>ANI</aut>/p' y.xml Can someone help me with SED or any other ways to remove those lines as I cant seem to figure out. :( |
"sed -n" means do not print unless instructed, and "p" means print. Thus your expression does the opposite of what you intended.
You want something like this: sed '/start/,/stop/ d' the second problem is the "/" characters inside the two addresses. These need to be escaped so they are not confused with the boundaries of the addresses. e.g.: /<\/channel><\/rss>/ |
All times are GMT -5. The time now is 11:23 PM. |