Click here to Skip to main content
15,902,447 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to arrange old project files into new project directory architecutre [ solved] Pin
econy5-Mar-13 10:08
econy5-Mar-13 10:08 
AnswerRe: How to arrange old project files into new project directory architecutre Pin
econy5-Mar-13 10:12
econy5-Mar-13 10:12 
QuestionHow can I output the conditional compilation constants to screen [Solved] Pin
econy5-Mar-13 6:56
econy5-Mar-13 6:56 
AnswerRe: How can I output the conditional compilation constants to screen Pin
Eddy Vluggen5-Mar-13 9:37
professionalEddy Vluggen5-Mar-13 9:37 
GeneralRe: How can I output the conditional compilation constants to screen Pin
econy5-Mar-13 10:09
econy5-Mar-13 10:09 
GeneralRe: How can I output the conditional compilation constants to screen Pin
Eddy Vluggen5-Mar-13 10:19
professionalEddy Vluggen5-Mar-13 10:19 
GeneralRe: How can I output the conditional compilation constants to screen Pin
Dave Kreskowiak5-Mar-13 14:01
mveDave Kreskowiak5-Mar-13 14:01 
QuestionConverting a text file to multiple arrays Pin
zrozerostang5-Mar-13 5:53
zrozerostang5-Mar-13 5:53 
Good Morning,

I am new to this forum, so hello, world!

I am attempting to read the following from a text file and turn each line into a separate array...

CSS
MIA JFK HNL LAX DFW
-5 -5 -10 -8 -6
0 3 12 8 2.5
3 0 14 8.5 3.5
12 12 0 4.5 8.5
8 8.5 4.5 0 3.5
2.5 3.5 8.5 3.5 0

Ideally the first line would be inserted into an array like {MIA,JFK,HNL,LAX,DFW}
Second line a new array with {-4, -4, -10, -7, -5}
And the last lines would be inserted into a two dimensional array:

{{0, 3, 12, 8, 2.5}, _
{3, 0, 14, 8.5, 3.5}, _
{12, 14, 0, 4.5, 8.5}, _
{8, 8.5, 4.5, 0, 3.5}, _
{2.5, 3.5, 8.5, 3.5, 0}}

I have been struggling for over two days with this.  This solution is probably easy... but it is evading me.  I have tried using the streamreader to no avail.  

Here is something I tried...

Public Class Form1
    Dim tmpArray() As String
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim sr As New StreamReader("..\..\info1.txt")
            Dim count As Integer = 0
            While Not sr.EndOfStream
                Dim line As String = Nothing
                line = sr.ReadToEnd()
                tmpArray() = line.Split(" ")
            End While


        Catch ex As Exception

        End Try


    End Sub
End Class


Any help would be greatly appreciated.

AnswerRe: Converting a text file to multiple arrays Pin
Eddy Vluggen5-Mar-13 9:48
professionalEddy Vluggen5-Mar-13 9:48 
QuestionHow can I get the application's solution configuration information [Solved] Pin
econy5-Mar-13 4:27
econy5-Mar-13 4:27 
AnswerRe: How can I get the application's solution configuration information Pin
Richard MacCutchan5-Mar-13 4:58
mveRichard MacCutchan5-Mar-13 4:58 
AnswerRe: How can I get the application's solution configuration information Pin
Eddy Vluggen5-Mar-13 5:00
professionalEddy Vluggen5-Mar-13 5:00 
QuestionWhat do you think visual data computing? Pin
David venewald4-Mar-13 22:57
David venewald4-Mar-13 22:57 
AnswerRe: What do you think visual data computing? Pin
Richard MacCutchan4-Mar-13 23:26
mveRichard MacCutchan4-Mar-13 23:26 
GeneralRe: What do you think visual data computing? Pin
David venewald5-Mar-13 14:32
David venewald5-Mar-13 14:32 
GeneralRe: What do you think visual data computing? Pin
Richard MacCutchan5-Mar-13 22:18
mveRichard MacCutchan5-Mar-13 22:18 
AnswerRe: What do you think visual data computing? Pin
Dave Kreskowiak5-Mar-13 1:19
mveDave Kreskowiak5-Mar-13 1:19 
GeneralRe: What do you think visual data computing? Pin
David venewald5-Mar-13 14:23
David venewald5-Mar-13 14:23 
GeneralRe: What do you think visual data computing? Pin
Dave Kreskowiak5-Mar-13 15:56
mveDave Kreskowiak5-Mar-13 15:56 
QuestionHow to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
J.Mañago4-Mar-13 16:37
J.Mañago4-Mar-13 16:37 
AnswerRe: How to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
Dave Kreskowiak5-Mar-13 1:22
mveDave Kreskowiak5-Mar-13 1:22 
GeneralRe: How to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
J.Mañago6-Mar-13 22:58
J.Mañago6-Mar-13 22:58 
GeneralRe: How to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
Dave Kreskowiak7-Mar-13 1:57
mveDave Kreskowiak7-Mar-13 1:57 
QuestionImplicit conversion operator(s) Pin
maxrock174-Mar-13 10:53
maxrock174-Mar-13 10:53 
AnswerRe: Implicit conversion operator(s) Pin
Dave Kreskowiak5-Mar-13 2:24
mveDave Kreskowiak5-Mar-13 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.