Simple Machines Community Forum

General Community => Scripting Help => Topic started by: Julius_2000 on April 04, 2024, 05:40:34 AM

Title: Insert code into HTML for thousands of files?
Post by: Julius_2000 on April 04, 2024, 05:40:34 AM
Hi all!

So, we have a forum archive of an old, SMF unrelated forum where we only managed to salvage individual HTML files rather than a database. We use them as redirects in our current forum. Now that this old forum comes from a time before smartphones were widely available, I started to play around with the index file in order to make it more mobile friendly, which kind of worked.

So my question is: Does anyone of you know a convenient way to insert code into thousands of HTML files at once or in a bulk-like manner? My idea would be to analyze the required HTML elements/classes, write some css styles and inject them into each file. Doing it manually, though, would be a non-feasible way.

Any help would be greatly appreciated!
Title: Re: Insert code into HTML for thousands of files?
Post by: grega on April 04, 2024, 07:00:28 AM
Notepad++, search and replace in files.

searchreplace.png


Or programatically, python, php....
Title: Re: Insert code into HTML for thousands of files?
Post by: Julius_2000 on April 04, 2024, 10:23:55 AM
Ah! I didn't know it can do that. Thank you so much!