GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Lines don't all have same number of tabs in allCountries.txt  XML
Forum Index -> General
Author Message
springheeljim



Joined: 28/10/2013 00:53:38
Messages: 2
Offline

Hi,

I am writing a script to insert all the data in allCountries.zip into a database table, but when looking at a few of the lines in the file I noticed that not all lines have the same number of tabs. Won't this cause data to go in the wrong columns?

e.g. one line:

6940582 North Yorkshire North Yorkshire North Yorks 54.07369 -0.95032 P PPLS GB ENG J7 36UF 040 Europe/London 2010-05-25

(17 columns)

and another line:

2641209 North Yorkshire North Yorkshire County of North Yorkshire,NYK,North Yorkshire 54.16667 -1.5 A ADM2 GB GB ENG J7 1061300 28 Europe/London 2011-12-09

(19 columns)

Unless I'm missing something, the first line is missing a value (even if empty) for the population and elevation, so the last 5 columns would be:

population: 040
elevation: Europe/London
dem: 2010-05-25
timezone: [missing]
modification date: [missing]

Is this right?

Cheers,

Gus
springheeljim



Joined: 28/10/2013 00:53:38
Messages: 2
Offline

Sorry, I think this must have been something to do with the bash output (cat allCountries.txt | head -n 10) not copying properly into my text editor or something. I have checked it using a script and everything checks out fine.
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team