I am just making a try to get how fast PB can be making some comparations searching in 2 files at time...
I've tested the ReadString command and it is fast enough, but when looking for words in the line the process is slow...
My question is if there is some instruction to get the words in a line, something like
Code: Select all
a$=ReadString(0)
firstword$=word$(a$,1)
secondword$=word$(a$,2)
and so on....
Any ideas to acelerate the process of searching...?
I am talking of bigger files of more than 10 meg and with aprox. 50,000 lines.
That's what I made getting very slow results:
Code: Select all
OpenFile (0,"h:\test.obj")
While Eof(0) = 0
a$=ReadString(0)
If Left(a$,2)="v "
Gosub num
EndIf
d1x$=""
d1y$=""
d1z$=""
Wend
CloseFile(0)
End
num:
pos=2
Repeat
pos=pos+1
x$=Mid(a$,pos,1)
dx$=dx$+x$
Until x$=" "
Repeat
pos=pos+1
x$=Mid(a$,pos,1)
dy$=dy$+x$
Until x$=" "
Repeat
pos=pos+1
x$=Mid(a$,pos,1)
dz$=dz$+x$
Until Val(x$)=0
Return
v number number number
So I search for "v " in every line and if found, then the subroutine num try to get the 3 numbers that follow.