| 1. |
Solve : Replacing different text in many files "Find and Replace"? |
|
Answer» Hi 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" ) ) |
|