wxWidgets/distrib/msw/filerepl.bat
Bryan Petty 3ca6a5f046 second merge of the 2.2 branch (RL)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-08 06:11:51 +00:00

28 lines
707 B
Batchfile
Executable File

@echo off
Rem Replace a string with another string in the given files.
Rem The first argument is the string to be replaced.
Rem The second argument is the replacement string.
Rem The third argument is a file listing the files to be processed.
set keyword=%1
set repl=%2
set files=%3
echo s/%keyword/%repl/g > script.tmp
call %wxwin\distrib\msw\expdwild.bat %3 list.tmp
set len=%@LINES[%files]
do i = 0 to %len by 1
set line=%@LINE[list.tmp,%i]
if "%line" == "**EOF**" enddo
rem echo Cmd: grep %keyword %line
grep %keyword %line > size.tmp
if "%@FILESIZE[size.tmp]" == "0" enddo
sed -f script.tmp %line > file.tmp
move file.tmp %line
enddo
erase script.tmp
erase list.tmp
erase size.tmp
:end