Board logo

标题: 在每行后加文件后缀名 [打印本页]

作者: bbq123bbq     时间: 2007-2-3 15:06    标题: 在每行后加文件后缀名

kbB832353
KB822343
KB832359

如何在kbB832353后面添加.exe变成
kbB832353.exe
KB822343 .exe
KB832359.exe
作者: heicai     时间: 2007-2-3 15:17
我不会。你等的时间还不如手工加加得了
作者: namejm     时间: 2007-2-3 15:32

@echo off
for /f %%i in (test.txt) do echo %%i.exe
pause

作者: bbq123bbq     时间: 2007-2-3 15:49
谢谢...自己手动加要加好几十个的...
作者: amao     时间: 2007-2-3 15:51
sed "s/ *$//;s/$/\.exe/" test.txt
作者: jmz573515     时间: 2007-2-3 23:52

set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("a.txt")
do while file.atendofstream<>true
s=s & file.readline & ".exe" & vbcrlf
loop
file.close
set file=fso.opentextfile("a.txt",2)
file.write s
file.close

作者: anqing     时间: 2007-2-4 00:26
vbs都写了
sed,
5楼的朋友,能讲讲它的用法吗?
作者: amao     时间: 2007-2-4 00:32


  Quote:
Originally posted by anqing at 2007-2-4 00:26:
vbs都写了
sed,
5楼的朋友,能讲讲它的用法吗?

请看以下链接
http://www.cn-dos.net/forum/view ... 1&highlight=sed