VB 文本指定行字符串的替代

[复制链接]
查看11 | 回复0 | 2007-7-26 22:04:40 | 显示全部楼层 |阅读模式
'用VBS写的,做个参考吧!dim m(3,3) '要根据内容所定set fso=createobject("scripting.filesystemobject") set file=fso.opentextfile("1.txt") while file.atendofstreamtrue
h=h+1
n=file.readline:s=split(n):l=ubound(s)
for i=0 to l
m(h,i+1)=s(i)
next
wendfile.closem(2,2)="12":m(3,1)="10" '可以根据你想替换的内容进行修改for i=1 to 3
for j=1 to 3
if j=3 then
sm=sm & m(i,j) & vbcrlf
else
sm=sm & m(i,j) & " "
end if
nextnextset file=fso.opentextfile("1.txt",2) file.write smfile.closecreateobject("wscript.shell").run "notepad.exe 1.txt"
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行