Import Excel data to Mysql

Asked

Viewed 955 times

0

I am trying to make an import of an excel spreadsheet with 536 thousand records by mysql Workbench I saved the spreadsheet as csv but at the time of import it can import all lines but it pulls only the primary key(CNPJ) and leaves all other fields as 'NULL'

Here is my spreadsheet

inserir a descrição da imagem aqui

There is one more field to the side that can not see that is the field 'Obs'.

And in the bank it only matters that

inserir a descrição da imagem aqui

To make the import I am using this code

LOAD DATA LOCAL INFILE
'importexcel/testeimport1.csv'
INTO TABLE checagens
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS
(CNPJ,DataCadastro,Razao,
 Operadora,Linhas,Classificacao,
 Vigencia,mesesContrato,Fidelidade,
 ValorGasto,FixoEmpresa,Gestor,
 Celular,FixoGestor,Email,Obs);
  • 4

    tries to change FIELDS TERMINATED BY ',' by FIELDS TERMINATED BY ';' (semicolon)

  • kkkk thank you very much was that same, wanted to know pq can not be ',' same but beauty comments as a reply ai

  • The method that matters should be by default ; for cell division ...I think this is not sure. Usually works with me depending on the database...

  • 1

    Excel in Latin languages use ; as delimiter in csv files

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.