Re: converting .xls to delimited file

Поиск
Список
Период
Сортировка
От rob
Тема Re: converting .xls to delimited file
Дата
Msg-id 001901c07bc8$e1d915b0$4100fd0a@cabrion.org
обсуждение исходный текст
Ответ на converting .xls to delimited file  (William Staniewicz <wstan@localhostnl.demon.nl>)
Список pgsql-general
Save it as .TXT (Tab Delimited) format.  When you copy the data into
postgres you may need to define nulls as ''.  Excel text output does not
distinguish between nulls and blanks.  By default, the copy command defines
nulls as \0 so you may need to change that.  I personally prefer that blanks
be imported as nulls.

I use the following copy command when importing:

copy mytable from '/path/input.txt' with nulls as '';

Also: watch your date formats (postgres is pretty good about this itself)
and sometimes your negative number formats.  (i.e. -5 is OK 5- is not OK!)

Finally, Excel has a tendency to export several "blank" rows at the end
(delimiters are correct, but all fields are blank).  I generally remove
these rows either before or after importing.

--rob



----- Original Message -----
From: "Alfonso Peniche" <alfonso@iteso.mx>
Cc: <pgsql-general@postgresql.org>; <pgsql-novice@postgresql.org>
Sent: Wednesday, January 10, 2001 10:32 AM
Subject: Re: converting .xls to delimited file


> Try saving it as a .CSV file and then you can choose the delimiter you
> want.
>
> William Staniewicz wrote:
>
> > Is there any way to convert an Excel file (".xls")
> > to a delimited file? Maybe using sed?
> >
> >                         Bill
>
>


В списке pgsql-general по дате отправления:

Предыдущее
От:
Дата:
Сообщение: How to tell if that UPDATE worked?
Следующее
От: "rob"
Дата:
Сообщение: Re: [HACKERS] Re: still no log