Jump to content

erro ao importar csv para banco de dados

Recommended Posts


Bom dia pessoal!

Estou exportando um arquivo do excel para csv com vb net e em seguida importando no postgresql

mas o arquivo convertito está com algumas virgulas no final (como na imagem) ,,,,,

E no código :

set client_encoding to 'iso-8859-1';
COPY dados1 FROM 'C:\Program Files\Leoretorico\CCMUpgrade\data2.csv' WITH DELIMITER ',' CSV HEADER;

o delimitador é justamente a virgula, ou seja o banco de dados reconhece as virgulas do final como outras colunas a serem importadas.

como posso fazer para ignorar isso?


Edited by pmg
remove formatacao; adicionei GeSHi

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.