How to use sed for replacing #x001c with blank?

Viewed 27

I am getting the below error while working on XML:- XML Production Error: Character '#x001c' does not fulfill production 'CharData'.

I used sed command as below to remove the above character from the source XML file-

sed -i -E "s/#x001c//g" $src_file

Am I using the correct syntax for replacing the character '#x001c' with blank? Please confirm.

Thanks in Advance!

1 Answers

You are using it correct except you do not need the -E flag as you are not using extended regular expressions in this case. See man sed for explanations on the flags

So this will work (tested)

sed -i 's/#x001c//g' file.txt 
Related