Search txt 4 word, replace with file location

October 22, 2010 at 08:34:28
Specs: Windows 7 H/Prem, 2Ghz/3Gb
I have around 100,000 html files that I need to do a search/replace on.

I currently have the word "Manchester" in all of these files which needs replacing with the full file path location;

C:\Demo_Folder\Manchester_file_001.html
C:\Demo_Folder\Manchester_file_002.html

Your help would really help me sort out my mind blowing task I've been given.

Thanx in advance
SuperZ


See More: Search txt 4 word, replace with file location

Report •


#1
October 22, 2010 at 08:55:22
Making a new thread every day is more likely to just annoy us, and increase the odds that no one answers your post(s).

How To Ask Questions The Smart Way


Report •

#2
October 22, 2010 at 09:39:57
I'm glad it ain't Just me.

I've got a short list of users who are 'read for amusement only'. Some for quantity; some for quality.


=====================================
Life is too important to be taken seriously.

M2


Report •

#3
October 22, 2010 at 09:42:45
Hi Razor,

I do apologise for doing it this way, however I have tried to ask all these questions in one big post however that was unfortunate and didn't recieve any reply's. I think this was because it was too much information at once to try and build into a single script.

http://www.computing.net/answers/pr...

Anyhow, this is the last part of the process and hopefully I shouldn't need anymore help with this project.

Again apologies if this has annoyed anyone on here


Report •

Related Solutions

#4
October 22, 2010 at 09:51:04
"I currently have the word "Manchester" in all of these files "

In the FILE or FILENAME?

Not at all the same thing.


=====================================
Life is too important to be taken seriously.

M2


Report •

#5
October 22, 2010 at 10:38:26
Hi M2,

Thanks for the reply and apologies for the annoyance this might have caused to you, but I do hope you understand my reasoning behind splitting each section.

The actual word that needs to be replaced is in the file itself not the filename.

Thanks
SuperZee


Report •

#6
October 22, 2010 at 10:49:18
A bat is not great for handling html.

How big are the files?


=====================================
Life is too important to be taken seriously.

M2


Report •

#7
October 22, 2010 at 11:32:12
the largest file is 14kb.

Report •

#8
October 25, 2010 at 11:48:24
Get CHANGE.COM

http://violet-fire.com/CHANGE.zip

==================================

@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/b *.html') do (
move /y %%a #
change # "myword" "%%~DPa"
move /y # %%a
)


=====================================
Life is too important to be taken seriously.

M2


Report •

Ask Question