Given a delimited file in the following format
- fields delimited by a pipe char
|
- text fields are unquoted
- some text field values contain an escaped pipe
\|, an escaped line feed \\n or escaped carriage return \\r
1|text containing the pipe \| character|3
^^^
what the correct combination of pgloader options might be to successfully load this file?
I tried
pgloader --type csv --field "field1,field2,field3" \
--with "fields terminated by '|'" \
--with "fields not enclosed" \
path/to/file.csv \
postgresql://user@host:port/dbname?tablename=schema.table
Which obviously didn't work for me as pgloader sees four fields instead of three.
Any insights would be highly appreciated.
Given a delimited file in the following format
|\|, an escaped line feed\\nor escaped carriage return\\r1|text containing the pipe \| character|3 ^^^what the correct combination of
pgloaderoptions might be to successfully load this file?I tried
Which obviously didn't work for me as
pgloadersees four fields instead of three.Any insights would be highly appreciated.