| От | Holger Klawitter |
|---|---|
| Тема | Re: importing tab delimited, text enclosed by " |
| Дата | |
| Msg-id | 39D1A50C.85EA0E82@klawitter.de обсуждение исходный текст |
| Ответ на | importing tab delimited, text enclosed by " (Andrew Gould <andrewgould@yahoo.com>) |
| Список | pgsql-general |
Andrew Gould wrote:
>
> I have a file of data that is tab delimited, with text
> fields enclosed by quotation marks.
>
> I know I can use the copy command to load the data;
> and that tab delimited is the default. How do I tell
> Postgres to remove the quotation marks?
It is probably easiest to remove the quote with a script
(like the following perl program).
while(<>){
chop;
@a = split(/\t/,$_);
@a = map { s/^"(.*)"$/$1/; $_; } @a;
printf "%s\n", join("\t",@a);
}
Regards,
Mit freundlichem Gruß,
Holger Klawitter
--
Holger Klawitter +49 (0)251 484 0637
holger@klawitter.de http://www.klawitter.de/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера