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

Discussion in 'Visual Basic ( VB )' started by kobuna, Sep 20, 2011.

  1. kobuna

    kobuna New Member

    Joined:
    Jul 22, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice