postgresql - Postgres COPY command - fields with commas, quoted with double quotes -
I searched and searched for some posts related to postgre CSV import, but nothing that resolves my current problem is.
I use the postgres copy command at all times to bring data from second source data sources to the current 100 million row Conflicts with CCV file, comma-delimited . The problem is with so many rows: Fields enclosed in double quotes with embedded commas. Fields are not correctly parsed and I get an error: Generally when these I get ridiculous rows ad hoc, but this file is so big that I'm hoping to defend it from something else in a normal way. There is not a possibility to ask for a modified data format. This is distorted CSV. has three values: The line you are having trouble with, repeats the double values: me It does not appear that anything in it can be as clear as the correct version is ambiguous: should it be I think you have to fix it by hand. A quick For reference purposes, I have seen the closest thing to the CSV standard and in section 2 it is to say:
009098,0981098094, "something", "something else", "" this one, okay, there is a problem, "one more thing"
"Error: additional data after the last expected column"
'/path/to/file.csv' csv header quote '' 'for example
is "pancakes"
Home
009098,0981098094, "something", "something else", "" this one, okay, there is a problem "" another thing "^^ ^^
"it should be one, ok, a problem" or is it
"" Is okay The problem is "" "?
sed one-liner If you have a specific type of broken line , Then he should be able to work with it.
5 Each field can be attached in double quotes (although some Ogram, like do not use Microsoft Excel, double quotes) if the area can not see inside are connected in double quotation marks, double quotation field. For example: "AAA", "BBB", "CCF", CRLF, Y, xxx [...] 7. If double-quotations are used to attach the field, then appear within a field A double quote giving will be saved before with another double quote. For example: "AAA", "B" "BB", "CCC"
Comments
Post a Comment