Imports Microsoft.VisualBasic.FileIO

Module Module1

    Sub Main()
        Dim output As IO.StreamWriter
	Dim dataFile As TextFieldParser
	Dim Row() As String
	Dim montelo As New List(Of String)
        Dim kibika As New List(Of Double)
        Dim xora As New List(Of String)
        Dim timh As New List(Of Integer)       

        
        output = IO.File.CreateText("data.csv")

        output.WriteLine("Land Rover,3.1,G.B,20000")
        output.WriteLine("Viper,2.0,USA,24000")
        output.WriteLine("Clio,1.2,France,10000")
        output.WriteLine("500,1.5,Italy,15000")
        output.Close()
	dataFile = New TextFieldParser("data.csv")


	dataFile.TextFieldType = FieldType.Delimited
        dataFile.SetDelimiters(",")
        
        While Not dataFile.EndOfData

            Row = dataFile.ReadFields()
            Console.WriteLine(Row(0) + " " + Row(3))
            montelo.Add(Row(0))
            kibika.Add(Row(1))
            xora.Add(Row(2))
            timh.Add(Row(3))

        End While
        

        For i As Integer = 0 To montelo.Count - 1
            Console.Write(montelo.Item(i) + vbTab)
            Console.Write(kibika.Item(i))
            Console.Write(xora.Item(i))
            Console.Write(timh.Item(i))
            Console.WriteLine()
        Next
        Console.ReadKey()
    End Sub

End Module
