@echo off
rem Let findstr to find the LINE you want (only once):
for /f "delims=" %%a in ('findstr "to_timestamp" t1.txt') do set "_line=%%a"
SET _line2=%_line:*to_timestamp=%
SET _line3=%_line2:*)=%
set _rep_str=('07-10-13 07:07:29','%%d-%%m-%%y %%h:%%i:%%s')
CALL SET _result=%%_line:%_line2%=%%
CALL SET _result2=%%_line2:%_line3%=%%
CALL SET _result=%%_line:%_line2%=%%
CALL SET _result=%_result:to_timestamp=STR_TO_DATE%
echo %_result%%_rep_str%%_line3% >> Output.txt
::echo %_rep_str% >> Output.txt
::echo %_line3% >> Output.txt
PAUSE
上面的代码适用于第一行 // findstr的出现,但我想对文本文件的每一行执行相同的操作。
怎么做?