Click to See Complete Forum and Search --> : Text processing & File I/O


AlexC
October 3rd, 2001, 05:18 AM
I'm trying to read in data from a text file (data is in column format) and store it in arrays. Is there any simple method to do it, or must I read in line by line and process each line character by character?

deghost
October 3rd, 2001, 03:32 PM
you can read each line and then separate easily by the Split() command.
dim strData() as String
dim nData() as Integer
dim Line as String
dim i as Integer
...
read line string here into Line
...
strData=Split(Line," ")
ReDim nData(0 to UBound(strData))
for i=0 to UBound(strData)
nData(i)=strData(i)
next i

This code might need some small fixes because i didn't check it...

----------
The @host is everywhere!
----------