CODE: [Copy to clipboard]
:: Replace.bat - Sample of replace text
:: Will Sort - 12:47 2005-7-26
@echo off
copy test1.txt test2.txt > nul
echo e 100 "1r|" 1a 0d 0a "e" 0d 0a > _replace.dbg
for %%s in (rcx 9 n_replace.edl w q) do echo %%s >> _replace.dbg
debug < _replace.dbg
edlin test2.txt < _replace.edl
::以下的debug脚本是为文件去处最后的文本结束标记1A,它是edlin添加的
echo e 00 83 e9 01 > _replace.dbg
echo g=00 03 >> _replace.dbg
for %%s in (w q) do echo %%s>> _replace.dbg
debug test2.txt < _replace.dbg
::以上语句删除结束标记1A
for %%f in (_replace*.*) do del %%f
也可以不用edlin实现类似的功能,比如以下的程序: