problem solved

solution was had to use "readlines()" not "read()"

thanks Niphlod

Here's working result

def import_a_tab_file():
    tabbed_file = 
open(os.path.join(request.folder,'static','city.txt')).readlines() 
    for line in tabbed_file:
        splitted = line.split('\t')       
        db.TempCity.insert(geoNamesID = splitted[0], cityName = 
splitted[1], asciiCityName = splitted[2], alternativeNames = splitted[3], 
latitude = splitted[4], longitude = splitted[5], featureClass = 
splitted[6], featureCode = splitted[7], countryCode = splitted[8], 
altCountryCode = splitted[9], admin1Code = splitted[10], admin2Code = 
splitted[11], admin3Code = splitted[12], admin4Code = splitted[13], 
population = splitted[14], elevation = splitted[15], dem = splitted[16], 
timeZone = splitted[17], geoNamesModDate = splitted[18]) 
    return locals()


-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to