I have a number of files, with varying sizes. But I want to accomplish the same thing with all of them, load them into a string(,).
Over the last many hours, I've searched for many variations of code similar to this with some small changes it seems, but even then I could only get a single row to load in at best:
Dim strimport As String() = {}
Dim strimportsplit As String(,) = {}
Dim i As Integer = 0
strimport = File.ReadAllLines("C:\test.txt")
For i = 0 To strimport.Length - 1
strimportsplit = strimport(i).Split(New Char() {vbTab}) 'This line doesn't work
Next
This is an example of my files (only they're significantly larger):
aaa fff 0
bbb ggg 1
ccc hhh 2
ddd iii 3
eee jjj 4
This is basically how i'd want the above to load into my array from external text files:
Dim strexample As String(,) = {{"aaa", "fff", "0"},
{"bbb", "ggg", "1"},
{"ccc", "hhh", "2"},
{"ddd", "iii", "3"},
{"eee", "jjj", "4"}}
I've even tried adding all of my tables as string(,)'s to VB manually. That works... But putting it in manually like that jumps up the filesize to ~30mb and gives me a MASSIVE performance hit. Not very ideal.
My question is, how can I load from a text file into a string(,) similar to my last example above?
Thank you very much in advance.