日期:2014-05-17  浏览次数:20697 次

求一bat指令写法,高手来。
c:\1.txt   内容:

....
.....
<body>
....
....



需要一指令 将  "谢谢" 写入并存为 2.txt

2.txt

....
.....
<body>
谢谢
....
....

------最佳解决方案--------------------
[code=BatchFile]@(for /f "delims=" %%a in ('findstr /n .* c:\1.txt') do @(
  set "line=%%a"
  setlocal enabledelayedexpansion
  set "line=!line:*:=!"
  echo.!line!
  if "!line!"=="<body>" echo 谢谢
  endlocal
))>c:\2.txt[/code]