0

I think the title speaks for itself. How can I replace multiple strings in multiple files?

For example, I have the following strings:

home.php, blog.php, forums.php, contact.php, etc.

And I want to replace all of them with these, respectively:

home.html, blog.html, forums.html, contact.html, etc.

These are strings in files. They happen to look like file names because they are in HTML hyperlinks. There are hundreds of occurrences and I want to replace them all at once.

I'm using Windows 7 OS. Is there any native Windows command or off-the-shelf software that can do this? I can develop a programmatic solution, e.g., in PHP, because I can have all strings in JSON, XML or array formats, but that's a last resort.

1 Answers1

0

A simple array of strings will do if you have any programming skills. Create a for each loop (or for loop throughout the whole array) and recreate the string by dividing the string with '.' as delimiter, so that home.php becomes home and php, replacing second item and then creating string from substrings again. If you only intend to rename php files to html files, you can simply replace every occurence of php with html.

This can be achieved with every scripting and programming language possible, so let us know if you need simple example in language which syntax you're familiar with.