Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

needed - Find & Replace on multiple HTML files

  • 10-05-2005 3:16pm
    #1
    Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,596 Mod ✭✭✭✭


    We've a coupla hundred html files with absolute hyperlinks.

    Anyone know an app that will allow them to be changed preferably from the command line ?


Comments

  • Registered Users, Registered Users 2 Posts: 102 ✭✭cormy


    If the files are on a unix box ....
    $ for I in `find /htmlfilesroot -name *.html`    ## Use the 'find' criteria you need
    > do
    > cat $I | sed 's/<old path>/<new path>/g' > tempfile
    > cp tempfile $I
    > done
    

    Might want to back up the html files first though ;-)

    [edit=CM] - undeleted - it's nice to see the alternatives [/edit]


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh




  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,596 Mod ✭✭✭✭Capt'n Midnight


    Wild Edit![/url]
    Thanks
    CrippleWare - €31 if the file is more than 10KB (they are mostly small.)
    /methinks I'll have a look for SED for windows


  • Registered Users, Registered Users 2 Posts: 78 ✭✭de8o


    I use a tool called filescan. Freeware. However I can't find it on the web now. I can send you a copy if you want.


  • Registered Users, Registered Users 2 Posts: 78 ✭✭de8o


    found filescan

    Filescan


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 17,441 ✭✭✭✭jesus_thats_gre


    dreamweaver does it..


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,596 Mod ✭✭✭✭Capt'n Midnight


    http://gnuwin32.sourceforge.net/packages.html - decided to use sed instead

    You end up with this sort of thing (not debuged)
    for /R %%i in (*.htm?) do sed -r s£file:///X:/folder%%20name£/£ %%i %%i.BAK

    Walk through folders
    two %'s because in a batch file - NB. a space is now %%20
    £ - because the symbol after s is the delimiter and Find "£" filename returned nothing


Advertisement