Powerfull search and replace software?
April 8, 2008 7:57 PM
Subscribe
[Search/replace filter] Is there a free (or really cheap) software that would let me do a batch search and replace where the name of the file is used as pasted text?
I have about 300 html files.
I want to add a string of text in the file that would include the first 3 characters of the name of the file.
For example :
in the file 100_xxx.xxx I want to add a string that would go :
a href="zzzzzzzzzz?100" blabla /a
I found a lot of software that do complex search and replace, but none that lets you use the name of the file.
I could start by adding the link with my current search/replace software, and use some variable in place of the numbers, so I'd need something like : find variable, replace with (first 3 char of file name)
If the (first 3 characters) part is too hard, I could also settle for the full name, and I'd search/delete the last part of the name, since there is only about 10 variations of the ending part.
Additional difficulty : these files are in UNIX and they need to stay that way (else i have to manually open each one and convert them), so I'd need a program that wont encode them in DOS format. And I only have access to a Windows machine.
Does anyone know about such a software?
I'm guessing that there might be a way to do it with regular expressions, but I only know the basic concept of it, and I have no idea 'where' you do the regex. I'd have to install PHP? Perl? I have minimal knowledge of PHP, none of Perl.
I'm starting to wonder which would be faster : learning a new language and regex or just manually editing these 300 files. Ok, to be honest, I think I already spent more time trying to find that software than what it would have taken me to edit them manually...
Thanks for your help!
And you might have guessed, English isn't my main language, so please forgive mistakes
posted by domi_p to computers & internet (14 comments total)
1 user marked this as a favorite
posted by mullingitover at 8:14 PM on April 8, 2008