Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004

    Unanswered: Load data to MySql with varying comma delimited data

    I have a (CDR) text data file delimited by commas. Each entry varies from 20 to 37 entries per line. How do I insert this data into a MySql database and make sure each field is always placed in the same column?


    IS,1018387657,204252,16820,9b71dfce933daa55f0f2cd8 f01970c6f,4909651,5,NumB,1,F,NamB,1,F,Name,1,,VarI D,1,borg_telcom,40,1,9d66ae38-1dd1-11b2-a31c800001fffd42,sylantro,PU,4085584731,SIP,SIP,si p:4085584731@;user=phone,billing, AUDIO,,1

    IS,1018387657,204252,16820,9b71dfce933daa55f0f2cd8 f01970c6f,4
    1,SIP,SIP,sip:4085584731@;user=ph one,sylan

    Line 1 has 37 comma delimeted fields as opposed to line 2 that only has 23.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Vancouver, BC
    I would paste Line 1 into Excel so you get all the fields you need and then paste Line 2 into the appropriate columns. Then I would use concantonate to pull it back into the format I need. Copy from Excel to notepad and save.

  3. #3
    Join Date
    Dec 2003

    Re: Load data to MySql with varying comma delimited data

    have you heard of split method?
    you can read a line form the file using systemfile object
    then split it using split method in VB
    then insert each part in its plase!!

    get it or you need an example?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts