I am working with Postgres+Postgis to handle spatial data, i was using a dataset with CSV files (id,timestamp,latitude,longitude) and i was copying the data from the CSV files into the database like so:
cat mycsv.csv | psql -d mydatabase -c "COPY mytable (id ,datetime ,lat ,lon) from stdin WITH DELIMITER ','"
Now i am using a diferent dataset of CSV files and im having trouble copying it to the database. The new CSV file has a polyline and is formated like this:
val1,val2,val3,"[[-8.618643, 41.141412], [-8.618499, 41.141376], [-8.620326, 41.14251]]"
I wanted to import the polyline into a geometry array or as a text field (WKT), my final goal is to import the polyline and store it as a geometry type line in a table.
The problem is, since the delimiter is ',' and the polyline is an array of coordinates separated my ',' i get the obvious error:
ERROR: extra data after last expected column
Is there a way of having more than 1 delimiter, or a diferent aprouch for this problem?