Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx
                                            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
**********************************************************************


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux