7
I need to make a command that finds and replaces a directory path by another path, in several HTML files, example of part of the HTML file:
<DIV STYLE="margin-top:6pt;margin-left:36pt;" >< FONT ID="f16" >
<A HREF="file:/export100/DOCS_AB/export200/ab.c" >
file:/export100/DOCS_AB/export200/ab.c</A></FONT></DIV>
<DIV STYLE="margin-top:6pt;margin-left:36pt;" >< FONT ID="f16">
<A HREF="file:/export100/DOCS_CD/export200/cd.c">
file:/export100/DOCS_CD/export200/cd.c</A></FONT></DIV>
Directory names change as well as sources .C
, I tried with the commands find
and sed
thus:
find ./ -name *.html | xargs sed -i 's_/export_/media/pendrive_g'
The problem is that directories and sources always change the name.
I wish command would return this to me:
<DIV STYLE="margin-top:6pt;margin-left:36pt;"><FONT ID="f16">
<A HREF="file:/media/pendrive/"nome_arquivo".c">
file:/media/pendrive/"nome_arquivo".c</A></FONT></DIV>
The tag
<FONT></FONT>
fell into disuse a long time ago. can include this in attributestyle
ofdiv
.– mutlei
An initial idea to make this work, but that is extremely bad to be a final solution, would be to take the direct path to the file. Another idea would be the use of softlinks.
– mutlei
The problem is that I can’t modify the html file, the only thing I can and want to do is change the directory names to point to the USB stick.
– Rakiz
script I don’t know anymore has a little program that you do it very quickly and easily . You will only have the trouble of downloading and upar follow the TEXTREP download link Download TEXTREP
– Arsom Nolasco