Windows脚本 - 编辑文本文件

时间:2012-09-14 13:13:25

标签: windows scripting batch-file cmd

C:\来电\ records.txt

11 record(s) received

5021462426325

5021462426325

5021462426325

5021462426325

5021462426325

8901090213511

8901090213511

8901090213511

8901090213511

0080432400708

0080432400708

所需的文件内容格式

5021462426325,5021462426325,5021462426325,5021462426325,5021462426325,8901090213511,8901090213511,8901090213511,8901090213511,0080432400708,0080432400708

然后将其从C:\Incoming复制到C:\Outgoing,并将旧文件放在C:\Stored中。

1 个答案:

答案 0 :(得分:1)

for /f "tokens=* skip=1" %%i in (C:\Incoming\records.txt) do echo|set /p="%%i,">>C:\Outgoing\records.txt
move C:\Incoming\records.txt C:\Stored\records.txt