Create CSV file : CSV « Development « VB.Net Tutorial






Public Class Tester
    Public Shared Sub Main

        Dim csvFile As String = My.Application.Info.DirectoryPath & "\Test.csv"
        Dim outFile As IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(csvFile, False)


        outFile.WriteLine("Column 1, Column 2, Column 3")
        outFile.WriteLine("1.23, 4.56, 7.89")
        outFile.WriteLine("3.21, 6.54, 9.87")
        outFile.Close()

        Console.WriteLine(My.Computer.FileSystem.ReadAllText(csvFile))


    End Sub

End Class
Column 1, Column 2, Column 3
1.23, 4.56, 7.89
3.21, 6.54, 9.87








7.33.CSV
7.33.1.Create CSV file
7.33.2.Read in and process a CSV file
7.33.3.Use system default editor to open a CSV file