Batch program to Find/Replace ?

  • Thread starter Thread starter Shadow
  • Start date Start date
S

Shadow

Anyone know of this kind of prog? I posted a Q originally about web site
management
and had no reply. Now I'll post that question in bits ;-)

TIA

S.
 
Shadow said:
Anyone know of this kind of prog? I posted a Q originally about web site
management
and had no reply. Now I'll post that question in bits ;-)

http://www.student.northpark.edu/pemente/sed/minitrue.htm
download:
http://www.idiotsdelight.net/minitrue/

Minitrue is a search and replace program which can be used in batch
files.
It can handle any kind of file, while sed can only handle text files.
I find it easier to learn than sed.

Here is an example batch file I used to test it.

rem this batfile performs three tests of minitrue
rem the file assign.com has to be in the same dir
rem look at that file in a hex viewer first, see all the hex00
rem change all hex00 to hex01, un-rem next line to do it
mtr -nlx -v:Grbk:brbk:mabk \x00 = \x01 -- assign.com
rem -nlx means -n=no display, just do it
rem -l means generate a logfile, -x means turn off the regular
expressions
rem -v:Grbk:brbk:mabk just sets some nicer colors in display
rem but I don't use any display here, so it is not necessary
rem look at the file assign com after running, see all the hex00 have
changed into hex01
rem see the backup file has been generated, and the logfile tells us
about the changes
rem
rem change all hexff to hexfe, un-rem the next line to do it
rem mtr -nlx -v:Grbk:brbk:mabk \xff = \xfe -- assign.com
rem
rem conclusion: minitrue can change anything to anything, even in
binary files
rem
rem test if it matters if we remove the -x
rem mtr -nl -v:Grbk:brbk:mabk \x00 = \x01 -- assign.com
rem it works too, no problem

I used a copy of the dos file assign.com to test it on.

Minitrue is a freeware gem, it is very small, has enormous
possibilities, and the help files are readable.
 
Back
Top