Results 1 to 6 of 6

Thread: Importing structured data into tables...

  1. #1
    Join Date
    Jan 2003
    Location
    DE
    Posts
    27

    Question Importing structured data into tables...

    Good news everybody...

    I'm making a delivery to a special entity on main_table.

    No, the problem is importing data into MySQL from a .CSV file originated in M$ Excel. Yes, I can import the file; but it is not imported as I want it to be imported.
    I have several comma seperated and "" enclosed values numerals as well as alphanumericals.

    How can I import the different columns to a structured table!?

    When I try to import the file, it is always put into the first field and not devided up into the different table specific columns...

    Tanks for help...

  2. #2
    Join Date
    Jan 2003
    Location
    DE
    Posts
    27

    I know this...

    http://linuxselfhelp.com/mysql/manua...al.html#IDX367

    I know these contents of MySQL help, BUT I have a problem to import a .CSV file. The deal is I can't get anything else then the f***** Excel file...
    If I had to convert the .CSV file into an easy readable .txt file I could as well type in the data by hand

  3. #3
    Join Date
    Feb 2003
    Location
    Johannesburg, South Africa
    Posts
    145
    Did you specify field termination characters etc.?

    Have a look here to see what I mean: http://www.mysql.com/doc/en/LOAD_DATA.html and http://www.mysql.com/doc/en/mysqlimport.html

    Cheers

  4. #4
    Join Date
    Jan 2003
    Location
    DE
    Posts
    27
    I did check that, yes.
    The main problem is the formating of the text/tab/csv file...

    It looks like this:

    HOLLSR01 34 0 7J29JNT1809x 0 0 Compaq Proliant DL360 G2 0 ITO CSUS 0 0
    HOLMAP01 35 x.x.x.x 7J27JNT1J02H 0 0 Compaq Proliant DL 360 G2 0 Oliver Klein / ITO DSDN 0 0

    But it should look like this:

    HOLLSR01 34 0 7J29JNT1809x 0 0 Compaq Proliant DL360 G2 0 ITO CSUS 0 0
    HOLMAP01 35 x.x.x.x 7J27JNT1J02H 0 0 Compaq Proliant DL 360 G2 0 Oliver Klein / ITO DSDN 0 0

    It's like putting it up all by hand if I can't read it ordered... see the problem?

    ----

    Oh, well the formating doesn't show on the post... it looks alike, but it's not. You know the DOS or TAB formated files. They are not native enough to be read clearly...
    Last edited by MuSQLe; 02-26-2003 at 04:23 AM.

  5. #5
    Join Date
    Feb 2003
    Location
    Johannesburg, South Africa
    Posts
    145
    You can attache a txt file. It may be helpfull if you could paste the before and after effects in the text file - then we can examine the problem a little closer.

    I have attached a text file on here just as a test.
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2003
    Location
    DE
    Posts
    27

    Lightbulb Problem solved...

    I just solved the problem...

    Reading some Excel help brought the idea of a multi-conversion of the .CSV file. By loading the .CSV file in an Excelsheet and then filling all empty spaces with 'NULL' values and then extracting it into a ';'-separated-file I was able to pull the info into a structured table in the right order...

    Thanks for the discussion though!


    Greets
    Tom

Posting Permissions

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