|
From: jhaberla99 on 16 Apr 2008 16:27 Is there a method to replace the greater than and less than symbols with < and > for processing in an XML file? I had tried to use sed similar to the following but it does not work: $ echo "test>1w3" |sed 's/>/>/g' test>gt;1w3
From: John W. Krahn on 16 Apr 2008 16:30 jhaberla99(a)gmail.com wrote: > Is there a method to replace the greater than and less than symbols > with < and > for processing in an XML file? I had tried to use > sed similar to the following but it does not work: > > $ echo "test>1w3" |sed 's/>/>/g' > test>gt;1w3 echo "test>1w3" |sed 's/>/\>/g' John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall
From: Chris Mattern on 16 Apr 2008 17:30 On 2008-04-16, jhaberla99(a)gmail.com <jhaberla99(a)gmail.com> wrote: > Is there a method to replace the greater than and less than symbols > with < and > for processing in an XML file? I had tried to use > sed similar to the following but it does not work: > > $ echo "test>1w3" |sed 's/>/>/g' > test>gt;1w3 > "&" is a special character in the replacement operand of substitution REs, meaning "what got matched by the match operand." In this case, that was ">", so ">" becomes ">gt;". You need to escape it to tell sed not to treat it as a special character: $ echo "test>1w3" |sed 's/>/\>/g' test>1w3 -- Christopher Mattern NOTICE Thank you for noticing this new notice Your noticing it has been noted And will be reported to the authorities
From: Stephane CHAZELAS on 17 Apr 2008 02:21 2008-04-16, 13:27(-07), jhaberla99(a)gmail.com: > Is there a method to replace the greater than and less than symbols > with < and > for processing in an XML file? I had tried to use > sed similar to the following but it does not work: > > $ echo "test>1w3" |sed 's/>/>/g' > test>gt;1w3 If you have GNU recode: recode ..html -- St�phane
|
Pages: 1 Prev: simple makefile help Next: selectively add the end of the line |