Combine GENAMES txt country files?

Guys I don’t wanna use all countries file I only need some countries.

Since they come in separate files how do I combine those files into in table?

what’s wrong with having all countries in the DB? it’s easier to set a flag than adding new countries when needed.

Thanks buddy. I don’t wanna waist time on scanning countries I am not interested on. It will also put unnecessary stress on my server and increase load time. Plus I don’t need GB and GB of data just the data I require

I use LOAD DATA INFILE to upload first and then each and one of them into same table. It appears to be working but I am not sure if that’s the right way.

Please need your pro tips on this one!

Don’t underestimate the power of databases.

Even MySQL, which some would consider a poor choice to use as an “industry” database, is capable of efficiently processing massive databases.

The main problems are most often due to poorly planned architecture and poorly crafted queries.

That said, as long as your “list” is stable and unchanging I see no problem with you curating and consolidating it local and importing that to live.

Guys please teach me how to marge 2 or more geonames country files into one?

What options do you have as source files?

How to go about it would depend on where the data is coming from, eg. CSV files only vs. database tables only.

I take for example es.txt and encode it to utf-16 then use:

LOAD DATA INFILE 'C:/Users/Me/Documents/New folder/New folder/New folder/New folder/ES_16.txt' INTO TABLE geonames.geoname;

I use this to upload 3 countries into same table. It appears to work but I am not sure that’s the correct way!

P.S. I am using Apache → PHPMyadmin SQL. Do I also have to encode into utf-16 those files?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.