1829378 Members
5450 Online
109991 Solutions
New Discussion

Re: sed help

 
SOLVED
Go to solution
kholikt
Super Advisor

sed help

I am writing some script to delete one of the HTML code from a html file.

This dynamic site was generated with CodeChargemall>


But I have problem using sed because of the "<" and ">" inside the html syntax
abc
5 REPLIES 5
Sridhar Bhaskarla
Honored Contributor
Solution

Re: sed help

Hi,

Did you try this?

string=">CodeCharge<"
sed '/'"$string"'/d' data

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Carlos Fernandez Riera
Honored Contributor

Re: sed help

create a file with all the change you need

s/
unsupported
KapilRaj
Honored Contributor

Re: sed help

Use ";" instead of "/" .....

kaps
Nothing is impossible
Balaji N
Honored Contributor

Re: sed help

$ cat a.html
This dynamic site was generated with CodeChargemall>


$ sed -e 's/<\/a>//' a.html
This dynamic site was generated with CodeChargemall>



here is a dry run. hope this helps.
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
John Meissner
Esteemed Contributor

Re: sed help

have you tried escaping the < and the /'s in your file?

for example if you wanted to get rid of the word

you could try this:
sed 's/\
//'
All paths lead to destiny