VB 操作文本文件
发布网友
发布时间:2022-04-22 14:54
我来回答
共2个回答
热心网友
时间:2023-08-02 08:17
Open "路径" For Input as #1
Do While Not EOF(1)
Line Input #1,S
St=St & S & IIF(Eof(1),"",vbCrlf)
Loop
Close #1
Dim A
A=Split(St,vbcrlf)
For i=0 to Ubound(A)
A(i)="小" & A(I)
Next
Open "文件路径" For output as #1
Print #1,Join(A,vbCrlf)
Close #1
热心网友
时间:2023-08-02 08:17
dim R as string
Open "C:\1.txt" For Input as #1
Open "C:\2.txt" For output as #2
Do While Not EOF(1)
Line Input #1,R
print #2, "小";R
Loop
Close #1
close #2
kill "C:\1.txt"
rename "C:\2.txt" as "C:\1.txt