How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database

Поиск
Список
Период
Сортировка
От Daniel Tourde
Тема How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database
Дата
Msg-id 200604111024.30145.ted@foi.se
обсуждение исходный текст
Список pgsql-general
Hello,

I am trying to import an Excel file in my database (8.0.7). I think I am
supposed to create an CSV file out of my Excel file and somehow, feed the
database with it. My pronblem is that I don't really know how to do it... :(
Can anyone give me a hint about how to do that?
One last "detail", the Excel files contains roughly 45.000 lines and 15
columns. So, I need a fast and efficient method.

Here is my database:

--
-- PostgreSQL database dump
--

SET client_encoding = 'UNICODE';
SET check_function_bodies = false;
SET client_min_messages = warning;

SET search_path = public, pg_catalog;

--
-- Data for Name: Flight Traffic; Type: TABLE DATA; Schema: public; Owner: ted
--

COPY "Flight Traffic" ("AR", "ICAOAIRP", "MOTORTYP", "VIKT", "ICAOTYP",
"FROMTO", "ANTAL", "CLASS", "SUBCLASS", "BULLERKLASS", "MILJOKLASS",
"ANTAL_PAX", "ARRDEP", "INTDOM", "KUNDNAMN") FROM stdin;
2004    ESDF    -       0       RALL    ESME    1       P       F       3
0       0       A       D       FORSBERG
\.


--
-- PostgreSQL database dump complete
--


And here is the .CSV i try to import:

2004,"ESDF","-",0,"RALL","ESME",1,"P","F",3,0,0,"A","D","FORSBERG, N MARTIN"



                        Daniel
--
**********************************************************************
Daniel TOURDE                            E-mail : daniel.tourde@foi.se
                                            Tel : +46 (0)8-55 50 32 12
                                            Fax : +46 (0)8-55 50 30 68
                                       Cellular :  +46 (0)70-849 93 40
FOI, Swedish Defence Research Agency; Systemteknik
Department of Aviation Environmental Research
SE-164 90 Stockholm, Sweden
**********************************************************************

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

Предыдущее
От: v.suryaprabha@gmail.com
Дата:
Сообщение: Re: how to prevent generating same clipids
Следующее
От: Kaloyan Iliev
Дата:
Сообщение: Re: installing and using autodoc