open "in.txt" for input as #1 open "out.txt" for output as #2 dim s as string do while not eof(1) line input #1,s if s like "teststring*" then print #2,s end if loop close #1 close #2 kill "in.txt" name "out.txt" as "in.txt"大体就是这个意思
错了,把上面的if s like "teststring*" then改成if not (s like "teststring*") then
open "out.txt" for output as #2
dim s as string
do while not eof(1)
line input #1,s
if s like "teststring*" then
print #2,s
end if
loop
close #1
close #2
kill "in.txt"
name "out.txt" as "in.txt"大体就是这个意思