Importing a comma delimited text file?

xterminal

Member
Joined
Aug 20, 2003
Messages
5
Hopefully a simple question...

Im looking to duplicate the process used for importing comma-delimited text files to a database in VB.NET. Im pretty sure I cant use Access automation-- first because I dont want to require eventual users fo the program to have Access installed, and second because the files Im working with have a number of fields per row that far exceeds what I can automatically import using VFP, Access, or SQL Server. (Most of them have ~1400 fields per row.) Bascially, Im looking for a faster and easier way to do it than I am now; I have a function that reads the line character by character looking for commas, and when it hits one, returning a string between the start and the comma as the next field.

Is there some sort of SPLIT-style command I can use to chop the string up all at once and have everything tossed into a big array, perhaps? (As an added quirk, I also have th duplicate the common "if its in quotes, ignore the commas therein" constraint.)

Thanks,
R
 
You Could try the Split function or string.split method. This allows you to set a DELIMITER for it to work on, I used a ; to get over the , problem. Dont know if it will handle 1400 fields but it might be worth a go.

Search for string.split in the help for examples.
 
Back
Top