Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   how to read csv(different number of columns) file into array (http://www.go4expert.com/forums/read-csv-columns-file-array-t26742/)

kobuna 20Sep2011 14:11

how to read csv(different number of columns) file into array
 
Hi all,

I'm having a problem in reading a csv file into array. Below is the sample of the csv file (consist of 6 rows of data).

Code:

2,1,1,FF,FRESH FRUITS,ACTIVE,PURCHASE,0,0
3,1,2,AAA,AAAA,ACTIVE,SALES,0,1
1,1,3,BBB,BBBB,INACTIVE,SALES,1,1
6,1,4,CCC,CCCC,ACTIVE,SALES,1,0
5,3,1
5,3,2

How am I going to split the elements(different number of columns) and put into array by using vb6? I'm intended to use two dimensions array to hold the elements.
Anyone can help on this? Thanks in advance.

p/s: I can do the read and load all the elements correctly if number of columns are the same.


All times are GMT +5.5. The time now is 04:36.