Inserting Code Into Multiple Files

TheWicker

Senior Member
Joined
May 15, 2008
Messages
812
Reaction score
270
Hey guys need a bit of an advice. I have around 3000 html files and I would need to place a bit of code into each of these files code in the exact same spot. Meaning I would like to place this part of code BEFORE or AFTER a particular peace of code on each of those html pages. How do I do this easiest. Is there such a function in notepad++, dreamweaver or similar?
 
Hey guys need a bit of an advice. I have around 3000 html files and I would need to place a bit of code into each of these files code in the exact same spot. Meaning I would like to place this part of code BEFORE or AFTER a particular peace of code on each of those html pages. How do I do this easiest. Is there such a function in notepad++, dreamweaver or similar?

Use dreamweaver and use the search function and it will have replace with option when you press CTRL + F. If you need anymore help just shoot me a pm.
 
Thanks for your answer. I am aware of this function, but it's pretty limited. This will replace me the code in ONE file. But I have 3000 of them and I am looking to save time and not open each file separately and put the code in it.

What I'm looking for is a batch replace function for multiple (thousands) files.

EDIT: Looks like I've found a cool little app that does that. Here it is if someone's having the same problem:

http://www.digitalvolcano.co.uk/content/textcrawler
 
Last edited:
Code:
Thanks for your answer. I am aware of this function, but it's pretty  limited. This will replace me the code in ONE file. But I have 3000 of  them and I am looking to save time and not open each file separately and  put the code in it.

Use WinAutomation To Do It Again And Again
 
Notepad++ has a 'Search and replace' function that can work on directories. It also has just a plain 'search' on directories. The only caveat is it won't be formatted with new lines. To access it, do ctrl+f, go to the 'Find in files' tab and there you have your options. Be sure to click 'replace in files' and not 'find all'. Otherwise it will just search for what your replace and return the files and lines.
 
Notepad++ has a 'Search and replace' function that can work on directories. It also has just a plain 'search' on directories. The only caveat is it won't be formatted with new lines. To access it, do ctrl+f, go to the 'Find in files' tab and there you have your options. Be sure to click 'replace in files' and not 'find all'. Otherwise it will just search for what your replace and return the files and lines.

Cheers, can't believe I've missed this... I'm using notepad++ every day.
 
Ignore the caveat, I just did some testing. If you select 'Extended' for the search mode (bottom left), you can put in new lines using \r\n . If you want tabs you can use \t . Using both is this: \r\n\t
 
+1 to notepad++, although I'm more used to UltraEdit's replace in files function, mainly because I've had a copy for ages (but it's bloatware now compared to notepad++).
 
Back
Top