#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    2
    Rep Power
    0
    can somebody please tell me where I am going wrong here?

    I'm trying to import a CSV file into a table, but everytime I do it it puts eveything into only 2 fields (in the first record)

    The command I'm using is...

    mysqlimport -d -h localhost -p -u root -v database ~home/table.csv fields-terminated-by=,

    a sample line from the csv would look like:

    field1,field2,field3

    please help!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    10
    Rep Power
    0
    Check carriage returns at the end of line.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by ThePrezLee:
    can somebody please tell me where I am going wrong here?

    I'm trying to import a CSV file into a table, but everytime I do it it puts eveything into only 2 fields (in the first record)

    The command I'm using is...

    mysqlimport -d -h localhost -p -u root -v database ~home/table.csv fields-terminated-by=,

    a sample line from the csv would look like:

    field1,field2,field3

    please help!
    [/quote]

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    2
    Rep Power
    0
    Thanks, I actually solved this a few days after posting the message - a collegue wrote a program called "migrate" that does the job just fine
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    4
    Rep Power
    0
    Could you post the program to the board? (Provided it's a script and not compiled, of course!)

    Chris

Similar Threads

  1. Importing CSV file into Postgres
    By mvallabh in forum PostgreSQL Help
    Replies: 0
    Last Post: October 9th, 2003, 07:21 AM
  2. importing csv to mysql automatically
    By tomuksm in forum MySQL Help
    Replies: 1
    Last Post: September 1st, 2003, 04:37 AM
  3. importing to mysql | xls -> csv date format problem
    By jamesbond2002 in forum MySQL Help
    Replies: 2
    Last Post: August 29th, 2002, 09:21 AM
  4. Replies: 3
    Last Post: January 26th, 2002, 03:23 PM
  5. Replies: 12
    Last Post: October 20th, 2001, 10:48 PM

IMN logo majestic logo threadwatch logo seochat tools logo