简体   繁体   中英

csv file to phpmyadmin import error

here is the pattern of my csv file

--------------------------------------------------------------
|   col1    |   col2   |           |   col4   |            |  
--------------------------------------------------------------
|   col1    |   col2   |           |   col4   |            |   
--------------------------------------------------------------
|   col1    |   col2   |           |   col4   |            |   
--------------------------------------------------------------
|   col1    |   col2   |           |   col4   |            |   
--------------------------------------------------------------
|   col1    |   col2   |           |   col4   |            |   
--------------------------------------------------------------
|   col1    |   col2   |           |   col4   |            |  
-------------------------------------------------------------- 

i have something like this, empty columns on the table in .csv file in excel 2010. empty column has default data set in phpmyadmin. while importing it's throwing Invalid column count in CSV input on line 1.

how can i solve this?

thanks in advance.!

Edit:

here is the sample of my csv file

-----------------------------------------------------------------------------
|   9    |   6   |           |   Yes, Capacitive   |   3.5 Inches   |      |
-----------------------------------------------------------------------------
|   9    |   6   |           |   Yes, Capacitive   |   4.5 Inches   |      |  
-----------------------------------------------------------------------------
|   9    |   6   |           |   Yes, Capacitive   |   4.5 Inches   |      |   
-----------------------------------------------------------------------------
|   9    |   6   |           |   Yes, Capacitive   |   3.5 Inches   |      |   
-----------------------------------------------------------------------------
|   9    |   6   |           |   Yes, Capacitive   |   4.5 Inches   |      |  
-----------------------------------------------------------------------------
|   9    |   6   |           |   Yes, Capacitive   |    4 Inches    |      | 
----------------------------------------------------------------------------- 

first row ends at eight line and u can see some of the data cells dont have quotes, why it's not including by default??

All that i did is

  1. Imported the file.
  2. selected the Format to CSV using load data
  3. Replaced Columns separated with: to comma(,)
  4. then press GO.

DONE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM