| От | Luis Carlos Ferreira |
|---|---|
| Тема | Re: problems with copy |
| Дата | |
| Msg-id | 200709281321.38410.lcf@tuxedo.com.ar обсуждение |
| Ответ на | problems with copy (chester c young <chestercyoung@yahoo.com>) |
| Список | pgsql-sql |
El Lun 24 Sep 2007 21:38, chester c young escribió:
> I'm getting lots of delimited files from Excel and MySQL users that,
> mid-file, begin truncating lines if ending in null values.
>
> for example:
> 1781: "one","two","three",,,,,,
> 1782: "one","two","three",,
> 1783: "one","two","three",,
>
> (delimited files from Open Office are well behaved)
>
> is there any way to handle this apparently standard aberration in PG?
>
You need to normalize the csv files filtering its contents with some script
...
...
$fields_in_table=9;
while (<>) {chomp;@f=split(",");for $i ( 0 .. $fields_in_table ) { print $f[$i].",";};print "\n";
};
...
...
--
Luis
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера