Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
mass edit .html files piplio
hi there, i want to replace all the %24 in .html files into something like &, and i have about 300 of these .html files, how do i do a mass find and replace?
both windows and unix program is fine.
i know grep can find those... that's about it. thanks mm.
Frontpage has a site wide search and replace as well as dreamweaver
There are ways to do it using VBA, visual basic in an MS Office application such as Word or Excel. You might try to Google "Batch Replace" VBA for some code. Romeo
... have you looked at the old unix 'sed', a simple but powerfull batch editor? Or a perl one-liner?
Here is a magic perl one-liner to change and replace all text strings "%24" to "&" in all of your *.html files in your current directory:
find . -type f -name "*.html" ¦ xargs perl -pi -e 's/%24/&/g';
Just type this on your unix console shell command prompt and you are done.
The character before the xargs is a vertical bar (unix pipe), just in case this forum software should mangle this character.
Caution: as this command will overwrite your files, test it first with some test files in a test directory and check the results, before you mangle your production files.
Disclaimer: although this command worked for me very well several times, you are using it at own risk.
Hope this helps.
can you not just open all your files in a text editor and use the find/replace feature there? conText maybe? or Crimson Editor?