n="AAAAAA5432543AA" 'n为要添加的内容
h=3 'h为要添加的行号 set ws=createobject("wscript.shell") set fso=createobject("scripting.filesystemobject") set file=fso.opentextfile("1.txt") m=file.readall file.close s=split(m,vbcrlf):l=ubound(s) for i=0 to l if i<>h-1 then sm=sm & s(i) &vbcrlf else sm=sm & n &vbcrlf&s(i) &vbcrlf end if next set file=fso.opentextfile("1.txt",2) file.write sm file.close ws.run "1.txt" |
|