J
Jeff
Hello all!
I created a successful program that reads data from a reliable
tab-delimited file - or so I thought. After getting everything to work
with small files, I changed the input to a larger file that was created
by the same program with the same format so hopefully there shouldnt be
any problem.
Unfortunately after the change, my program could no longer read in data
from the file. The split only populates the first element of the array.
Any attempt to read any other elements throws a ***Index was outside
the bounds of the array*** error.
I realize that the obvious solution is that the larger file must be an
invalid format, but Ive double and triple checked it and the only
difference is that one file has many, many more entries. In fact, the
the first 200 lines of each file are identical character for character.
oRead = oFile.OpenText("Library.txt") 'miniLib.txt works fine
oRead.ReadLine() 'first line contains
headers
While oRead.Peek <> -1
dim LineIn as string = oRead.ReadLine()
dim LineData() as string = split(LineIn, chr(9))
' LineData(0) is valid
' LineData(1) is not valid
' LineData(2) is not valid, etc...
...process LineData...
end while
The input files have 24 fields separated by tabs so LineData should be
defined up until LineData(23). Im clueless. Why is split() being mean?
Someone please help! Thanks!
Jeff
I created a successful program that reads data from a reliable
tab-delimited file - or so I thought. After getting everything to work
with small files, I changed the input to a larger file that was created
by the same program with the same format so hopefully there shouldnt be
any problem.
Unfortunately after the change, my program could no longer read in data
from the file. The split only populates the first element of the array.
Any attempt to read any other elements throws a ***Index was outside
the bounds of the array*** error.
I realize that the obvious solution is that the larger file must be an
invalid format, but Ive double and triple checked it and the only
difference is that one file has many, many more entries. In fact, the
the first 200 lines of each file are identical character for character.
oRead = oFile.OpenText("Library.txt") 'miniLib.txt works fine
oRead.ReadLine() 'first line contains
headers
While oRead.Peek <> -1
dim LineIn as string = oRead.ReadLine()
dim LineData() as string = split(LineIn, chr(9))
' LineData(0) is valid
' LineData(1) is not valid
' LineData(2) is not valid, etc...
...process LineData...
end while
The input files have 24 fields separated by tabs so LineData should be
defined up until LineData(23). Im clueless. Why is split() being mean?
Someone please help! Thanks!
Jeff