1.

Solve : Replacing different text in many files "Find and Replace"?

Answer»

Hi

Every ( needs to be followed by )
You may have better luck after appending
Code: [Select] )
)

Regards
Alan
Hello,

ALAN_BR wrote:
Every ( needs to be followed by )
You may have better luck after appending
Code:
)
)

Yes sorry they are all there, the end lines, I did not wanted to write all the code as it is all there in previous answers
Thanks Alan
Regards


This puzzles me...

I did remove the directory lines and only used *.mif and moved the batch to the folders with the files (under documents and settings) tried again and it could not find the files!!

I then move the folder out of documents and setttings to under C: and then it works!!

What causes this?

I would refer to have it under documents and settings if that is possible

RegardsQuote

There is up to 100 unique files (FILE1,file2,file3,file4,file5 ETC) and each of them has only one of the lines that needs to be changed, but this line can occur several HUNDREDS times in each file.

What happened to the d:\data directory? When the run environment is changed, the batch file must change accordingly. I probably should have made the code more bulletproof.

Code: [Select]@echo off
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%x in ('dir /a:-d /s /b "c:\documents and settings\soli004\data\*.mif"') do (
for /f "tokens=* delims=" %%i in ("%%x") do (
set input=%%i
.
.
.
echo !input! >> "%%x.chg"
)
)



Discussion

No Comment Found