[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 批处理每行末尾追加字符出错

  1. @echo off
  2. setlocal enabledelayedexpansion
  3. for %%ii in (he.txt) do (echo%ii good >>ref.txt)
  4. pause
复制代码
想在每行后面添加good,运行出错。

此时不应有 %ii。

回复 2# Batcher

运行结果是这个,如何修改代码?

i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good
i good

TOP

回复 2# Batcher

自己改好了,谢谢。

@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in (he.txt) do (
    echo %%i good >>ref.txt
  )
pause

TOP

返回列表