Page 1 of 1

Reading csv files?

Posted: Wed Apr 03, 2013 5:17 pm
by kiboro
I'm having a lot of trouble with trying to import csv files using copy from.

Vertica doesn't seem to handle csv at all well. I can use comma as a delimiter but
that's about it. Cmmas in quoted fields are erroneously picked up as column breaks,
carriage returns in quoted fields are not handled and, minor but annoying, I can't
skip the header row.

Is there any way to sensibly import a csv file?

I guess I can use a weird delimiter but I've never been able to find one which doesn't
appear in any of our very disparate data sets. The real killer is cr and lf in quoted
fields. Those are significant in some data sets.

Re: Reading csv files?

Posted: Wed Apr 03, 2013 7:43 pm
by becky
Hi!
What do you mean by:
I can use comma as a delimiter but that's about it.
I think we can use any delimiter we want using the DELIMITER option of the COPY command 8-)

And maybe this link'll help you out with carriage returns in quoted strings?

viewtopic.php?f=49&t=284&p=819&hilit=csv#p819