Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Import from .csv

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #8249
      thart
      Member

      I am trying to import a .csv file with the following characters:

      Escaped by \

      Lines terminated by rn

      Fields Terminated by ,

      Fields Enclosed by '

      I have tried several variations of this and I cannot get the first column (surname) to import. The fields are enclosed by single quotes, but, when I put a single quote in the Fields enclosed by box, I get an error message against the rn. I've tried putting in double quote, but no help either. I'm not getting error messages if I leave Fields Enclosed by empty, but the surname column just won't come over. I have checked the formatting and the column is set at “general” (I've tried changing it to text, but didn't make a difference)

      The first few columns are as follows:

      cust_id (auto)

      surname varchar (50) not null

      first varchar (50) not null

      First time user of this (and learning MySQL as well) and would appreciate any help you could give me.

      Thanks!

      Toni

      [5:35:59 AM][ 20 ms] load data local infile 'C:/phpdev/www/winestore/customers.csv' into table `Winestore`.`customer` fields escaped by '\' terminated by ',' enclosed by '”' lines terminated by 'rn' ( cust_id, surname, firstname, initial, title, addressline1, addressline2, addressline3, city, state, zipcode, country, phone, fax, email, birth_date, salary )

      [5:36:02 AM][ 0 ms] select * from `Winestore`.`customer` limit 0,5000

    • #15255
      Shadow
      Member

      If only one of the fields is enclosed by a certain character, then checking the “Optionally” checkbox may help.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.