postgresql csv copy unquoted newline found in data -


i have csv data in excel, , i'm importing postgresql. i'm opening excel csv file notepad editor (have tried notepad, wordpad , notepad++) , copying/pasting remote desktop connection linux machine. i'm using import statement within database: copy ltg_data '/home/keene/ltg_db/ltg_outbreak_jun9_15.csv' (format csv, header);

i error: error: unquoted newline found in data hint: use quoted csv field represent newline. context: copy ltg_data, line 175320

here's link csv file i'm using: http://greenandtheblue.com/ltg_outbreak_jun9_15.csv
i've researched issue lot , tried lot of things , must missing simple. appreciated.

the file linked doesn't appear have cr-lf line endings, suspect potentially issue since you're coming windows host. might try removing carriage returns using sed:

sed 's/\r//' ltg_outbreak_jun9_15.csv ltg_outbreak_jun9_15-nocr.csv

then copy resulting ...-nocr.csv file.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -