wxWidgets/distrib/msw/filerepl.bat
Vadim Zeitlin 2b5f62a0b2 merged 2.4 branch into the trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-04 14:11:26 +00:00

29 lines
720 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
Rem goto end
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