Forum Moderators: phranque
I want to replace them with <a href="newfilename61.htm">target file</a>
I'd like to do the operation in one shot. Is there a search and replace piece of software that will let me import a list of search targets with a complimentary list of replacements, so that the many different filenames that need to be changed will be replaced throughout all the files selected for the operation?
MM
find ./ -type f -exec sed -i 's/search string/replacement string/g' {} \; Be aware of that this will unfortunately update the "last edited" date of all files in the current catalog and following subcatalogs, whether they contain they string or not. I'm not sure how to avoid that.
You can do search/replace across multiple files easily.
I have a particular website that I install at various client sites, and always need to adjust some of the preloaded parameters in input boxes.
With Textpad, I just open up all 300 files, select Search/Replace, type in my texts, click "Replace All" and POOF! all 300 pages updated at once. Then I save all, then close all, and I'm done in under a minute.
I like that little program.
SEARCH/FIND (any occurences)...
oldfilename61.htm
oldfilename64.htm
oldfilename66.htm
oldfilename69.htm
oldfilename60.htm
oldfilename30.htm
oldfilename101.htm
oldfilename109b.htm
REPLACE...
newfilename61.htm
newfilename64.htm
newfilename66.htm
newfilename69.htm
newfilename60.htm
newfilename30.htm
newfilename101.htm
newfilename109b.htm
over many, many dir's and files, where each of the above oldfile names would not necessarily be found in every html file, nor would they be found in the order shown above... sort of "any instance of oldfilename10.htm should be replaced by newfilename10.htm" no matter what precedes or succedes it.
[edited by: royalelephant at 7:08 pm (utc) on Jan. 24, 2005]