第1个回答 2013-05-03
dim data,str as string
data=""
open "filename.txt" for input as #1
do
line input #1,str'从#1读(下)一行到str中
if str <> vbnullstring then'遇到的不是空字符串
data=date & str & vbcrlf'把data跟读取到的str串起来
end if
loop until eof(1)
close #1
open "filename.txt" for output as #2
print #2,data
close #2
'凭着记忆写的,有错请指出