Removing Backslash with Sed

Charles Curley charlescurley at charlescurley.com
Thu Sep 7 21:38:59 UTC 2006


On Thu, Sep 07, 2006 at 03:43:14PM -0400, R. G. Newbury wrote:
> I have large number of scanned images of documents, which have been 
> 'managed' by a windows program which produces an index page with a link 
> to each document, and a document page with links to each page in the 
> document. There are about 1400 document pages.
> Unfortunately the windows program produces a link in the form:
> <a href='..\index.html'><img src='..\header_index.jpg'>
> That is: containing backslashes.
> 
> I have tried to figure our a search/replace line for sed but nothing I 
> have tried works...in part I assume because the '\' is itself the 
> 'escape' character. Even so, search expressions like '..\\' do not work.
> 
> ANyone know how to do this? There are about 20 backslashes in each 
> document index page, so I am not even considering a manual method... 
> although that works...

Try this untested line on a throw-away file:

sed -i s/\\/\//g filename

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060907/fdb7cb21/attachment-0001.sig>


More information about the fedora-list mailing list