VB.NET - Read a Delimited Text File



Read a Delimited Text File


'Namespace: Microsoft.VisualBasic.FileIO

Dim filename As String = "c:\syntaxhelp.txt"
Dim fields As String()
Dim delimiter As String = Delimiter

Using parser As New TextFieldParser(filename)
    parser.SetDelimiters(delimiter)
    While Not parser.EndOfData
        ' Read in the fields for the current line
        fields = parser.ReadFields()
        ' Add code here to use data in fields variable.

    End While
End Using

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.