Note that there are some explanatory texts on larger screens.

plurals
  1. POvb.NET Arrays - Turning a String into a Table
    text
    copied!<p>I am working on a windows form application, and I have it reading a text file that has information stored in the form of a table. It looks somewhat like this:</p> <pre><code>ID Name URL 1 client1 client1.com 2 client2 client2.com 3 client3 client3.com </code></pre> <p>And so on... What I need to do is get this data to be read from a stream reader, that throws it into a string, including vbtabs and newlines, and then create an array out of that information, so that it acts as a table that I can then later pull information from based on the column names (i.e. ID, Name, URL) and the ID number. I do not have a lot of experience with arrays, so I was hoping to get some help here as how to do this.</p> <p>The code I have so far for this functionality is:</p> <pre><code>Dim readCLientTxtListReader As New StreamReader(strReplicationDataClientAccessListPath) Dim strClientAccessList As String = readCLientTxtListReader.ReadToEnd Console.Write(strClientAccessList) readCLientTxtListReader.Close() Dim i As Integer Dim aryClientAccessList() As String aryClientAccessList = strClientAccessList.Split(vbTab) For i = 0 To UBound(aryClientAccessList) Console.WriteLine(aryClientAccessList) Next i </code></pre> <p>The problem about this is that it just creates a new instance of the array as each individual string of characters between each vbtab. which means, the arrays look like:</p> <pre><code>ID Name URL 1 client1 client1.com 2 client2 client2.com 3 client3 client3.com </code></pre> <p>Which is not really what I need.</p> <p>Any ideas?</p> <p>If you need more info, let me know.</p> <p>Edit: As an added side-note, I believe multidimensional arrays are what I am looking for, and am currently looking them up now, but if you have any more information on these, I would greatly appreciate it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload