I'm trying to import data from a csv file into postgresql, unfortunately it's not perfectly formatted.
Example:
DATE,TIME,NUMERIC,NUMERIC,NUMERIC,NUMERIC,INTEGER
I want to import the data into a table with the columns:
timestamp with timezone, numeric, numeric, numeric, numeric, integer
For importing the data I use copy:
COPY tabledata FROM 'c:\Users\Public\Downloads\test.csv' DELIMITERS ',' CSV;
Of course it does not work, since date and time are separated by ',' so postgresql assumes that those are 2 separate data fields.
I've managed it to import the .csv into a table that is setup just like the .csv, however I need to have date and time as timestamp with timezone later on, and because I will be handling huge amounts of data a post import conversion would be my last choice because of performance issues.
I've tried to edit the .csv file prior to import with "sed 's/,/ /' EURUSD30.csv > EURUSD30E.csv" however I get an error saying that the command "'s/" is typed wrong or could not be found. I'm rather clueless because this seems to work for everybody else, but this would not be my first choice either.
It would be easier if postgresql could simply be told upon import to merge time and date into one timestamp value. Any ideas?
Thanks