I need to add to my project several two columns tables of data (from MS-Excel) I have saved in txt form, and I suppose I want to manage them in the form of lists or arrays.
Which is the easiest way to incorporate those files into the project?

Attachments
0,00	0.0000
0,01	0.0040
0,02	0.0080
0,03	0.0120
0,04	0.0160
0,05	0.0199
0,06	0.0239
0,07	0.0279
0,08	0.0319
0,09	0.0359
0,10	0.0398
0,11	0.0438
0,12	0.0478
0,13	0.0517
0,14	0.0557
0,15	0.0596
0,16	0.0636
0,17	0.0675
0,18	0.0714
0,19	0.0753
0,20	0.0793
0,21	0.0832
0,22	0.0871
0,23	0.0910
0,24	0.0948
0,25	0.0987
0,26	0.1026
0,27	0.1064
0,28	0.1103
0,29	0.1141
0,30	0.1179
0,31	0.1217
0,32	0.1255
0,33	0.1293
0,34	0.1331
0,35	0.1368
0,36	0.1406
0,37	0.1443
0,38	0.1480
0,39	0.1517
0,40	0.1554
0,41	0.1591

I have no idea of what you really need.:)

Lets start with the language first, are you using vb6 or vba?

How do you want to manage these excel coloumns?
Lastly, incorporate them into the project, which project?

The language I'm using is Microsoft Visual Basic 2010.
You have an example of the data I want to manage in the attached file: two columns with numbers. These data don't change and that is the reason I want to include them in the VB form, because I have to make several searches into those data. I have to search within the fist column and give the result of the second column/same row.
The project is just a vb form which some simple calculations and a few searches within a couple of bidimensional arrays, lists or whatever.
Afterwards I have to draw a chart, but this will be after the calculations.
For looking into the arrays I suppose I have to use the SEEK command, but first I need the array as part of the project??

Thank you.

Edited 5 Years Ago by solfinker: grammar mistake

This will be a VB.NET question. I have asked the mods to move it from here (VB4/5/6) to .Net. I'm sure you will get a solution soon.:)

You can use List(of T) to hold data.

Public Class FileData
        Public Property Num1 As String
        Public Property Num2 As String
    End Class

    Class Test
      Sub ReadData()
        Dim lst As New List(Of FileData)
        Dim path As String ="c:\path\Dnormal1.txt"

        Dim lines() As String = System.IO.File.ReadAllLines(path)

        For Each Str As String In lines
            Dim ar() As String = Str.Split(New String() {vbTab}, StringSplitOptions.RemoveEmptyEntries)
            If ar.Length = 2 Then
                lst.Add(New FileData() With {.Num1 = ar(0), .Num2 = ar(1)})
            End If
        Next
    End Sub
   End Class

Edit:
Correct the path.

Edited 5 Years Ago by __avd: Correct code.

Thank you.
I have an error in the lack of declaration of the MapPath

This article has been dead for over six months. Start a new discussion instead.