I have some csv data in excel, and I'm importing it into postgresql. I'm opening the excel csv file with a notepad editor (have tried notepad, wordpad and notepad++) and am then copying/pasting into a remote desktop connection to a linux machine. Then I'm using this import statement from within the database: COPY ltg_data FROM '/home/keene/ltg_db/ltg_outbreak_jun9_15.csv' (FORMAT CSV, HEADER);
I get this error: ERROR: unquoted newline found in data HINT: Use quoted CSV field to represent newline. CONTEXT: COPY ltg_data, line 175320
Here's the link to the csv file I'm using: http://greenandtheblue.com/ltg_outbreak_jun9_15.csv
I've researched the issue a lot and tried a lot of things and must be missing something fairly simple. Any help is very much appreciated.
The answer is very simple.
Add a page break in your excel file where your data ends.
Select just next cell (empty cell) after your last data cell and go to
File > Page Layout > Breaks > Insert Page Break
.Save your
csv file
andimport
it again withpgadmin
.