Search code examples
htmlspecial-characters

^C character after copying and pasting text from photoshop


Our designers provide HTML for our email marketing and often, I'll see a ^C character in it when viewed in vi. These are invisible in textmate.

It looks something like this

<td width="340" align="center">Odyssey T-shirt / ^C<br>&pound;000</td>

I want to write a sed script which finds and replaces these, but how can I search for this?


Solution

  • You can replace all occurences in the file using:

    cat YOURFILE.html | sed 's/^C/YOURSTRING/g'
    

    To type in ^C hit Ctrl-V and then Ctrl-C. Replace YOURSTRING with the string you want to replace and YOURFILE with the filename.