Importing a CSV

Help
Phill
2014-06-03
2014-06-15
  • Phill
    Phill
    2014-06-03

    I have been struggling with a CSV file import. Every time i try to import it i get and Error in query 1064 Syntax error near 'user_id' at line 1 etc. I tried to use "," and also ";" as separators but nothing has changed. All used CSV were made in Excel, set on UTF-8. Do you guys have any clues?

     
  • Paul
    Paul
    2014-06-03

    It will help to have a sample output of the file.

    Use dummy data if needed, but try to keep some of the same characters, and keep the same column names if possible, especially up to the 'user_id' complaint to see if there might be some special characters or if a possible DB keyword might be present.

     
  • Phill
    Phill
    2014-06-03

    i tried to download a csv (, and ;) from the DB which included the needed columns, changed the values but still cant import... same errors

     
  • Paul
    Paul
    2014-06-03

    Understood, that's what you said in the first post...

    Without seeing some example data that is trying to be imported, there's not much I can say, other than the separators is likely NOT the source of the problem, because it appears to fail either way based on what you've said, and around the same point.

    The failure in the same place leads me to believe there is likely something else wrong in the format somewhere, such as a special character, a stray quote [single or double], or possibly a DB keyword.

     
    Last edit: Paul 2014-06-03
  • Phill
    Phill
    2014-06-03

    So I exported a csv and opened in excel as i realized there are some weird characters in the first column, any clues?

    p.s. it doesnt work either with or w/o the quotation marks in the first line

     
    Last edit: Phill 2014-06-03
    Attachments
  • Paul
    Paul
    2014-06-04

    Using the file upload option with that import, correct?

    If so, can you try the import without the first row of column names. I believe some of the formatting is not correct, as as the date/time column should have quotes too, and the triple quoting around 'cowboy' may pose a problem as well.

    If you still have trouble, and if possible, can you post your table [structure only, so that I don't have to guess the data types], so I can load that structure locally and test loading the same info that you have? I can duplicate the sample data based on the images that you posted, but it will help speed things if you can post that small sample data set too.

    Unfortunately, data from an Excel export into csv form is not always "ready to import", and usually requires some "tweaking" to achieve the desired format that is suitable to import.

     
    Last edit: Paul 2014-06-04
  • Phill
    Phill
    2014-06-05

    Soo I figured out how to import the csv, it has to be imported in the particular product table, not through the left menu bar where the button import is...

     
  • Paul
    Paul
    2014-06-06

    Great! That's good to know.

    Did you have to delete the first row of column names before importing? It's been awhile since I've done one of those, so I'm just curious.

     
  • Phill
    Phill
    2014-06-06

    no i just put it in they way i sent u...

     
  • Phill
    Phill
    2014-06-06

    Btw using libreoffice is much better for exporting CSV files from xls/xlsx

     
  • Jakub Vrána
    Jakub Vrána
    2014-06-15

    Sorry about the confusion, I've clarified that the global import supports only SQL in the UI.