import txt file

sirrahhc

New member
Joined
Jan 3, 2006
Messages
4
Location
Nashville
Programming Experience
1-3
hey guys what's up?? i'm trying to import a .txt file. i've enclosed an example, it's delimeted and contains four or five fields with a couple hundred records. i'm trying to set up a program to import a txt file (from my documents) and store it for referencing. i'm ultimately wanting to output some of this data to an excel spreadsheet, but i just wanted to start w/ the import. i've enclosed what i have been able to get from the book (just finished a vb.net class but can't find this in my book). i've searched online for days but can't get it right. any help or point in the right direction is greatly appreciated!!
 

Attachments

  • Phase1.zip
    21 KB · Views: 29
  • Master.txt.txt
    75 bytes · Views: 31
Without looking at your attachment, there are basically two ways to get the data from a delimited file. You can use ADO.NET and treat it like a database or you can use a StreamReader. I'm not sure but you may have to include a schema file for TSV files, while CSV requires no additional help to use ADO.NET. To use a StreamReader you would get the individual values from a line like this:
VB.NET:
Dim values As String() = myStreamReader.ReadLine().Split(ControlChars.Tab)
 
Back
Top