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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -