I'm not going to give you the complete solution...

a) use https://docs.python.org/2/library/codecs.html to open the file
b) use os.path.join to concatenate pieces of paths to build the file 
location

c) assuming 
splitted = line.split('\t') 
you're going to get a list of values for every row. 
geonames format uses 19 fields for every row, so you'll get back a list 
with 19 fields in it.

Your first field would then be splitted[0], the second splitted[1] and so 
on.
e.g. the first line would be something like

splitted = ['3039154', 'El Tarter', 'El Tarter', ....]

you can then insert every piece to its own field pretty easily.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to