|
-
Apr 23rd, 2013, 07:07 PM
#9
Re: Help reading from csv file!
 Originally Posted by bbesase
Thanks guys. Except when I read in the lines, I don't know how to separate the values. I have multiple lines with 6 + values in each line, and I need to only read in the first 6 values. I dont need any more of the values exceeding that. I'm a noob at programming and have no clue what to do.
Well, you've already been given three ways to do it. Using ADO.NET, i.e. an OleDbDataAdapter, will read all the data straight into a DataTable so all the data is already split into rows and columns. If you use a StreamReader and its ReadLine method or File.ReadAllLines or .ReadLines then you'll call String.Split to split each line. If you use a TextFieldParser then the ReadFields method reads a line and splits it in one go. I suggest that you spend a bit more time studying the information already provided because you already have everything you need.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|