does anyone know how to split a tabbed delimited text file and read each column into a different dynamic array? The first two columns consist of strings and the last two columns are doubles.
dim reader as new io.streamreader ("Your file")
dim temparray() as string
dim a,b,c as new arraylist
while reader.peek > -1
temparray()=readre.readline.split(chrw(9))
a.add(temparray(0))
b.add(temparray(1))
c.add(temparray(2))
end while
sorry yes about the typo that was reader not readre. object reference not set to an instance of an object = your missing a new. Check you put new io.streamreader and new arraylist.
The following code puts the data into an arraylist called a and prints: hij klm I only want abc and hij to be in array a at position 0 and 1. I want def and klm to be in array to. Please someone tell me how to do this and how to split this string and where to put that into the code below??????? it would be much appreciated. im going mad.
Dim i AsInteger
Dim reader AsNew IO.StreamReader("C:\testing2.txt") Dim temparray(0) AsString Dim a AsNew ArrayList While reader.Peek > -1
temparray = reader.ReadLine.Split("ChrW(9)") EndWhile RichTextBox1.Text = a.Item(1) EndWhile EndWith Catch es As Exception MessageBox.Show(es.Message) Finally IfNot (sr IsNothing) Then sr.Close() EndIf EndTry EndSub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.