Re: CSV file - Using COPY Command - Double-Quotes
От | Daniel T. Staal |
---|---|
Тема | Re: CSV file - Using COPY Command - Double-Quotes |
Дата | |
Msg-id | 59870.63.172.115.138.1133904217.squirrel@MageHandbook.com обсуждение исходный текст |
Ответ на | CSV file - Using COPY Command - Double-Quotes (Walter <pgsql@thejohnsonplace.com>) |
Список | pgsql-novice |
On Tue, December 6, 2005 12:01 pm, Walter said: > All of the values within the CSV are surrounded with quotation marks. So > a null value for a field looks like "" > > I am trying to import the file and no matter what I do, it hits a null > date field and says > > invalid input syntax for type date : "" sed 's/,"",/,,/g' filename > filename.new Should do the trick... (That is: Replace ever occurance of ,"", with ,, in the file 'filename' and place the result in 'filename.new'. If you aren't on a Unix machine, you may have to find another tool to do the same.) Daniel T. Staal --------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
В списке pgsql-novice по дате отправления: