Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27333

read text into array

$
0
0
So im new to coding and basically whatim trying to do is Read my text file AppList.txt and parse it based on seperators.

My current code is the following
Code:

Dim a As String = My.Computer.FileSystem.ReadAllText(Application.StartupPath & "\AppList.txt")
Dim B As String() = a.Split(vbNewLine)
ListBox1.Items.AddRange(B)

Which correctly loads the lines from AppList.txt into the ListBox like below.

AppName1
AppName2
AppName3


Now i edited the Applist.txt adding a path and executable names seperated by ; 's like shown below.


AppName1;\\server\appname\;AppNameSetup1.exe
AppName2;\\server\appname\;AppNameSetup2.exe
AppName3;\\server\appname\;AppNameSetup3.exe


And im trying to change the original code to include parsing all three sets of text between the ; 's seperately but am completely lost.

Something like this i imagine. But i know its obviously not right. Basically it should still show the AppNames in the listbox. But i would also want to easily pull the \\server\appname\ and AppNameSetup1.exe for each one

Code:

Dim a As String = My.Computer.FileSystem.ReadAllText(Application.StartupPath & "\AppList.txt")
        Dim B As String() = a.Split(";")
        For I = 0 To UBound(B) - 1 Step 3

        Next
        ListBox1.Items.AddRange(I)
        End


Viewing all articles
Browse latest Browse all 27333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>