GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: tonton  XML
Profile for tonton -> Messages posted by tonton [3]
Author Message
OK it's made thanks

i create a table in my database
Code:
  CREATE TABLE "countryinfo" (
       iso_alpha2 char(2),
       iso_alpha3 char(3),
       iso_numeric integer,
       fips_code character varying(3),
       country character varying(200),
       capital character varying(200),
       areainsqkm double precision,
       population integer,
       continent char(2),
       tld CHAR(10),
       currency_code char(3),
       currency_name CHAR(15),
       phone character varying(20),
       languages character varying(200),
       geonameId int,
       neighbours character varying(50),
       equivalent_fips_code character varying(3)
  );
 

I change file countryInfo.txt in the file join 1countryInfo.txt

and use Code:
 
  copy countryInfo (iso_alpha2,iso_alpha3,iso_numeric,fips_code,country,capital,areainsqkm,population,continent,tld,currency_code,currency_name,phone,languages,geonameid,neighbours,equivalent_fips_code)from '1countryInfo.txt' null as '';
 

result : COPY 247

tonton
high marc thanks for your answer

i'am french and not sure my translate

i just search to understand how it is made and what it's mean !

it is something like having a fish and knowing phishing

so how to import that data into countryinfo tables

cause psql hanging with data starting with ##

what i have to delete for correct import
with table creat with the faq

http://forum.geonames.org/gforum/posts/list/67.page

copy countryInfo (iso_alpha2,iso_alpha3,iso_numeric,fips_code,name,capital,areaInSqKm,population,continent,languages,currency,geonameId) from 'countryInfo.txt' null as ''; not match cause
##^(?:AD)*(\d{3})$

does i delete a column
just ## and then ### #### so on
all things between # and $
i right quote in file for beeing accept data


newbee asking maybe

i use some post here and found i am not the only one in trouble to importe this file in the table

some change the table
some change the script or the file

but into some line there something like that :

##^(?:AD)*(\d{3})$

wich not like by psql

i remove line starting with # for comments

but what means this ##^(?:AD)*(\d{3})$ is it to be interpreted by some database functions ?
did we need to replace by something before import to countryInfo table

thanks for your works sure and you help ...

tonton
 
Profile for tonton -> Messages posted by tonton [3]
Go to:   
Powered by JForum 2.1.5 © JForum Team