I'm wondering if there is a service that to get a set of lat,long points that when connected into a polygon show the outline of a country
Ideally I would like to search by country, and get back an array of lat,long coordinates. Is there such a service?
IF you are happy to consider not using a webservice, this data is available at varying resolutions from Natural Earth. The data is in the public domain.
have a closer look here;
http://en.wikipedia.org/wiki/User:The_Anome/country_bounding_boxes
User:The Anome/country bounding boxes A first hack, based on all
places in the NGA GNS dataset, not (yet) properly handling latitude
wrap-round at ±180°. Country names are mapped from FIPS country codes.
This works pretty well for all countries that do not cross the 180°
meridian. Russia is a notable exception. This dataset does not include
the United States.
country longmin latmin longmax latmax
AA -70.983 12.400 -69.850 12.617
Antigua_and_ -62.417 16.817 -61.650 17.750
United_Arab_ 45.000 22.167 59.250 26.133
Afghanistan 60.433 29.150 75.033 38.484
Algeria -8.700 18.027 70.554 37.203
Azerbaijan 44.783 38.417 50.858 41.911
Albania 19.000 39.583 21.050 42.659
Armenia 43.443 38.857 46.589 41.300
Andorra 1.417 42.433 1.783 42.650
Angola 10.000 -33.806 24.350 -3.033
Argentina -73.533 -58.583 -53.367 -21.783
Australia 112.467 -55.050 168.000 -9.133
AT 122.983 -12.667 124.050 -12.000
Austria 1.200 46.373 19.000 49.017
AV -63.667 18.150 -62.917 18.600
Bahrain 45.000 25.000 50.954 26.566
Barbados -59.667 12.967 -59.383 13.333
Botswana 20.000 -28.517 29.350 24.583
BD -64.908 32.233 -64.617 32.417
Belgium 2.367 49.500 6.400 51.683
Bahamas -86.000 20.000 -70.000 29.547
Bangladesh 84.000 20.600 92.683 26.817
Belize -89.950 15.000 -75.000 18.483
Bosnia_and_H 15.746 42.558 19.671 45.268
Bolivia -69.650 -26.867 -57.550 9.678
Burma 91.833 6.000 102.000 28.350
Benin -4.000 5.000 92.219 21.322
Belarus 22.550 50.717 32.850 56.133
Solomon_Isla -130.000 -45.000 170.200 3.751 WRAPPED
Brazil -73.817 -33.733 -28.850 16.800
BS 39.700 -21.417 39.700 -21.417
Bhutan 80.000 26.217 92.717 30.000
Bulgaria 22.371 41.000 28.600 44.215
BV 3.278 -54.467 3.483 -54.386
Brunei 110.000 -2.000 120.000 15.000
Yahoo! GeoPlanet, the service Stack Overflow are using for their careers site seems to do bounding boxes.
Here is a blog post with detailed query examples.
This repo contains a set of square bounding boxes. Example below:
{
"AF": ["Afghanistan", [60.5284298033, 29.318572496, 75.1580277851, 38.4862816432]],
"AO": ["Angola", [11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998]],
"AL": ["Albania", [19.3044861183, 39.624997667, 21.0200403175, 42.6882473822]],
"AE": ["United Arab Emirates", [51.5795186705, 22.4969475367, 56.3968473651, 26.055464179]],
"AR": ["Argentina", [-73.4154357571, -55.25, -53.628348965, -21.8323104794]],
"AM": ["Armenia", [43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671]],
"AQ": ["Antarctica", [-180.0, -90.0, 180.0, -63.2706604895]],
"…"
}
Full set of boxes:
https://github.com/sandstrom/country-bounding-boxes
Related
After running these command all day, my head is on fire, I am now reaching out.
Please don't direct me to papers about Suest that are commonly mentioned on the web, I already checked them.
It seems there is a problem with storing the dy/dx values of the AME to merge between different models in the suest command in order to perform the test command.
What I would like to test is if the AME of the lower class/upper class/middle class in one regime/context is statistically significant from the lower class situated in another regime/context.
Dependent variable: 3 categories: renter, mortgaged homeownership, outright homeownership.
*Liberal_market
mlogit owner_housing_debt2 United_States United_Kingdom Swizerland c.age_centered
ib0.lower_class ib0.upper_class if homeownership_regimes==1 ,
baseoutcome(1)
margins , dydx(lower_class upper_class) coeflegend post
est store Liberal_market
*Family_financial_support
mlogit owner_housing_debt2 Belgium Finland France Ireland Luxembourg Norway Spain
ib0.lower_class ib0.upper_class if homeownership_regimes==2 , baseoutcome(1)
margins , dydx(lower_class upper_class) coeflegend post
est store Family_financial_support
est table Liberal_market Family_financial_support
suest Liberal_market Family_financial_support
**In the end, this is what I want to do:
test [Liberal_market]1.lower_class =[Family_financial_support]1.lower_class
*error message
Liberal_market was estimated with a nonstandard vce (delta)
r(322);
-Unfortunately, the following answer from Statalist regarding the nonstandard vce in suest- didn’t help me either
https://www.statalist.org/forums/forum/general-stata-discussion/general/1511169-can-not-use-suest-for-margins-after-probit-or-regress
Will appreciate your solution:)
Thank you. I tried your recommendation. Unfortunately, I could not find an organized document with examples for xlincom with margins.
I tried the following code, but my problem is withdrawing the margins of the independent variable categories (1.lower_class and 1.upper_class) from the 2 separate mlogit reg after suest. I mean, how to define in the command that I want 1.lower class from model A and 1.lower_class from model B in the margins and in the xlincom. Please see my example below:
mlogit owner_housing_debt2 ib0.lower_class ib0.upper_class if regime==1,
baseoutcome(1)
est store A
mlogit owner_housing_debt2 ib0.lower_class ib0.upper_class if regime==2,
baseoutcome(1)
est store B
suest A B
margins 1.lower_class 1.upper_class, coeflegend post
lincom _b[1.lower_class] - _b[1.upper_class]
I found a very useful regex code in order to extract product codes here, this is the expression:
\b((?:[a-z]+\S*\d+|\d\S*[a-z]+)[a-z\d_-]*)\b
It works almost perfectly, but I need to detect and extract only the product codes that have a length of at least 5 digits.
For example, for the following strings:
5T COFFEE BREW FOR BLACK & DECKER DCM-601B
10T COFFEE BREW FOR BLACK & DECKER DCM-1100B
10T COFFEE BREW FOR BLACK & DECKER DCM-1100W
8T COFFEE BREW FOR BLACK & DECKER CM-1509
Rice Cookers 15T DOMESTIC USE RC5428, ELECTRIC BLACK & DECKER
Rice Cookers 15T RC/5723 DOMESTIC USE, ELECTRIC BLACK & DECKER
Rice Cookers B D REF.RC3203
Hand mixer, S / M, PS62509R
SLOW COOKING POTS, HAMILTON BEACH, HB33136T
OVEN 110V TOSTA SANKEY REF.TO-9
24 PZA METAL TEAPOT S / M CHINA REF: 92479
ELECTRIC RICE COOKER, 1.5 L ROYAL ROA-15SV
ELECTRIC RICE COOKER, 1.8 L ROYAL ROA-18SV
ELECTRIC RICE COOKER, 2.2 L ROYAL ROA-22SV
ELECTRIC RICE COOKER, 2.8 L ROYAL ROA-28SV
Waffle Makers DOMESTIC USE, ELECTRIC BLACK & DECKER G-49TD
2.00 PZA TOAST OVEN, METAL / GLASS ROYAL, CHINA, REF: RTH-28A
20.00 PZA RICE, METAL, BLACK & DECKER, CHINA, REF: RCB550S
I get:
5TDCM-601B
10TDCM-1100B
10TDCM-1100W
8TCM-1509
15TRC5428
15TRC/5723
REF.RC3203
PS62509R
HB33136T
REF.TO-9
92479
ROA-15SV
ROA-18SV
ROA-22SV
ROA-28SV
G-49TD
2.00RTH-28A
20.00RCB550S
Desired outcome:
DCM-601B
DCM-1100B
DCM-1100W
CM-1509
RC5428
RC/5723
REF.RC3203
PS62509R
HB33136T
REF.TO-9
92479
ROA-15SV
ROA-18SV
ROA-22SV
ROA-28SV
G-49TD
RTH-28A
RCB550S
How can I do this?
If we assume that your codes contain 5 or more non-whitespace symbols, and there must be at least 1 digit, the regex for the codes will be:
\b(?!\d+\.\d+)(?=\S*\d)\S{5,}\b
See Demo 1
The (?!\d+\.\d+) disallows float/decimal numbers like 1.2345 or 12.44.
I'm not quite sure if I understood your question, but you can use a regex like this to get the product codes you want:
((?:\w{2,}\.)?\w{1,}[.\/-]?\d+\w+)(?=\b)
Working demo
I am compiling a list of video games.
At this time, I am currently using Wikipedia to do so.
As I copied ps3 games over to LibreCalc, the copied titles of the video games include citation brackets at the end of the line. Rather than remove this line by, I am trying to search and replace the brackets and their contents.
I continue to fail in this endeavor. An example below,
Rune Factory: Tides of Destiny[629]
Fight Night Champion[268]
Dragon Age II[209]
Major League Baseball 2K11[427]
MLB 11: The Show[459]
Warriors: Legends of Troy[817]
Dynasty Warriors 7[222]
Homefront[334]
Top Spin 4[773]
MotorStorm: Apocalypse[474]
Crysis 2[164]
Lego Star Wars III: The Clone Wars
The Tomb Raider Trilogy[765]
NASCAR 2011: The Game[488]
Shift 2: Unleashed[650]
Tiger Woods PGA Tour 12: The Masters[746]
WWE All Stars[839]
Michael Jackson: The Experience[448]
Rio[614]
Mortal Kombat[469]
Portal 2[563]
SOCOM 4: U.S. Navy SEALs[20]
AFL Live[16]
Operation Flashpoint: Red River[542]
Man vs. Wild[430]
Sniper: Ghost Warrior[679]
El Shaddai: Ascension of the Metatron[233]
Virtua Tennis 4[808]
Thor: God of Thunder[740]
MX vs. ATV Alive[478]
Brink[116]
Lego Pirates of the Caribbean: The Video Game[391]
Battle vs. Chess[82]
L.A. Noire[379]
Dirt 3[196]
Kung Fu Panda 2[377]
Hunted: The Demon's Forge[336]
Infamous 2[345]
Red Faction: Armageddon[599]
Yakuza: Dead Souls[849]
Duke Nukem Forever[217]
Alice: Madness Returns[29]
Child of Eden[146]
Transformers: Dark of the Moon[777]
Dungeon Siege III[218]
Cars 2: The Video Game[138]
F.E.A.R. 3[247]
Shadows of the Damned[647]
Atelier Meruru: The Apprentice of Arland[67]
Bleach: Soul Resurrección[108]
Angel Love Online[38]
Angel Senki
Air Conflicts: Secret Wars[24]
Harry Potter and the Deathly Hallows: Part II[322]
NCAA Football 12[511]
Captain America: Super Soldier[137]
Call of Juarez: The Cartel[136]
Phineas and Ferb: Across the 2nd Dimension[558]
Hyperdimension Neptunia Mk2[338]
Deus Ex: Human Revolution[191]
Bodycount[111]
Madden NFL 12[415]
Driver: San Francisco[216]
Dead Island[175]
Resistance 3[609]
Warhammer 40000: Space Marine[815]
NHL 12[526]
Tales of Xillia[718]
God of War: Origins Collection[298]
Tom Clancy's Splinter Cell Classic Trilogy HD[762]
Supremacy MMA[712]
Dark Souls[169]
Ico & Shadow of the Colossus Collection[340]
FIFA 12[263]
PES 2012: Pro Evolution Soccer[557]
Dynasty Warriors 7: Xtreme Legends[223]
Ra.One: The Game[584]
Crysis[163]
Rage[586]
Spider-Man: Edge of Time[692]
NBA 2K12[498]
The Cursed Crusade[733]
Ace Combat: Assault Horizon[12]
Skylanders: Spyro's Adventure[675]
Batman: Arkham City[79]
Ratchet & Clank: All 4 One[591]
Rocksmith[627]
The Sims 3: Pets[658]
The Adventures of Tintin: The Secret of the Unicorn[14]
Back to the Future: The Game[71]
Battlefield 3[83]
Dragon Ball Z: Ultimate Tenkaichi[212]
Puss in Boots[581]
The Idolmaster 2[736]
Uncharted 3: Drake's Deception[795]
GoldenEye 007: Reloaded[301]
The Lord of the Rings: War in the North[401]
Sonic Generations[683]
Call of Duty: Modern Warfare 3[131]
Metal Gear Solid HD Collection[445]
The Elder Scrolls V: Skyrim[236]
Lego Harry Potter: Years 5–7[388]
Assassin's Creed: Revelations[63]
Jurassic Park: The Game[358]
Cartoon Network: Punch Time Explosion XL[141]
Need for Speed: The Run[516]
Saints Row: The Third[633]
Apache: Air Assault[42]
After Hours Athletes[21]
Ni no Kuni[531]
WWE '12[838]
The King of Fighters XIII[371]
Just Dance 3[361]
Order Up![543]
Final Fantasy XIII-2[273]
Zack Zero[853]
Armored Core V[52]
NeverDead[520]
Soulcalibur V[689]
Kingdoms of Amalur: Reckoning[374]
The Darkness II[735]
Grand Slam Tennis 2[306]
Twisted Metal[787]
UFC Undisputed 3[792]
Binary Domain[95]
Asura's Wrath[64]
Syndicate[714]
Gal*Gun[288]
Naruto Shippuden: Ultimate Ninja Storm Generations[485]
SSX[698]
One Piece: Pirate Warriors[539][540]
Blades of Time[101]
Major League Baseball 2K12[428]
Mass Effect 3[436]
MLB 12: The Show[460]
Street Fighter X Tekken[706]
Top Gun: Hard Lock[771]
Mobile Suit Gundam Unicorn[465]
FIFA Street[265]
Silent Hill: Downpour[653]
Silent Hill HD Collection[654]
Ninja Gaiden 3[535]
Resident Evil: Operation Raccoon City[605]
Ridge Racer Unbounded[613]
Battleship[87]
Prototype 2[577]
Max Payne 3[438]
Dragon's Dogma[214]
Tom Clancy's Ghost Recon: Future Soldier[756]
Dirt: Showdown[197]
Inversion[350]
Tokyo Jungle[753]
Part of my problem seems to be that brackets are characters used in regular expressions.
Can some one assist me, or toss me in the right direction to solving this problem.
You can escape the brackets with a backslash so they are treated as regular characters. On that base, you could use the following regex to match all square brackets containing only digits:
\[[:digit:]*\]
When leaving the Replace with box empty, a search/replace run should remove all footnote marks in your example.
Since only the opening bracket is a special character for LO Calc, the following should work, too:
\[[:digit:]*]
I would really appreciate your thoughts on the best approach to the following problem. I am using a Car Classified listing example which is similar in nature to give an idea.
Problem: Extract a data tuple from the given text.
Here are some characteristics of the data.
The vocabulary (words) in the text is limited to a specific domain. Lets assume 100-200 words at the most.
Text that needs to be parsed is a headline like a Car Ad data shown below. So each record corresponds to one tuple (row).
In some cases some of the attributes may be missing. So for example, in raw data row #5 below the year is missing.
Some words go together (bigrams). Like "Low miles".
Historical data available = 10,000 records
Incoming New Data volume = 1000-1500 records / week
The expected output should be in the form of (Year,Make,Model, feature). So the output should look like
1 -> (2009, Ford, Fusion, SE)
2 -> (1997, Ford, Taurus, Wagon)
3 -> (2000, Mitsubishi, Mirage, DE)
4 -> (2007, Ford, Expedition, EL Limited)
5 -> ( , Honda, Accord, EX)
....
....
Raw Headline Data:
1 -> 2009 Ford Fusion SE - $7000
2 -> 1997 Ford Taurus Wagon - $800 (san jose east)
3 -> '00 Mitsubishi Mirage DE - $2499 (saratoga) pic
4 -> 2007 Ford Expedition EL Limited - $7800 (x)
5 -> Honda Accord ex low miles - $2800 (dublin / pleasanton / livermore) pic
6 -> 2004 HONDA ODASSEY LX 68K MILES - $10800 (danville / san ramon)
7 -> 93 LINCOLN MARK - $2000 (oakland east) pic
8 -> #######2006 LEXUS GS 430 BLACK ON BLACK 114KMI ####### - $19700 (san rafael) pic
9 -> 2004 Audi A4 1.8T FWD - $8900 (Sacramento) pic
10 -> #######2003 GMC C2500 HD EX-CAB 6.0 V8 EFI WHITE 4X4 ####### - $10575 (san rafael) pic
11 -> 1990 Toyota Corolla RUNS GOOD! GAS SAVER! 5SPEED CLEAN! REG 2011 O.B.O - $1600 (hayward / castro valley) pic img
12 -> HONDA ACCORD EX 2000 - $4900 (dublin / pleasanton / livermore) pic
13 -> 2009 Chevy Silverado LT Crew Cab - $23900 (dublin / pleasanton / livermore) pic
14 -> 2010 Acura TSX - V6 - TECH - $29900 (dublin / pleasanton / livermore) pic
15 -> 2003 Nissan Altima - $1830 (SF) pic
Possible choices:
A machine learning Text Classifier (Naive Bayes etc)
Regex
What I am trying to figure out is if RegEx is too complicated for the job and a Text classifier is an overkill?
If the choice is to go with a text classifier then what would you consider to be the easiest to implement.
Thanks in advance for your kind help.
This is a well studied problem called information extraction. It is not straight forward to do what you want to do, and it is not as simple as you make it sound (ie machine learning is not an overkill). There are several techniques, you should read an overview of the research area.
Check this IE library for writing extraction rule< I think it will work best for you problem.
There also example how to create fast dictionary matching.
I think that the ARX or Phoebus systems may suit your needs if you already have annotated data and a list of words associated to each field. Their approach is a mix of information extraction and information integration.
There are a few good entity recognition libraries. Have you taken a look at Apache opennlp?
As a user looking for a specific model of car the task is easier. I'm pretty sure I could classify, say, most Ford Rangers since I know what to look for with regexp.
I think your best bet is to write a function for each car model with type String -> Maybe Tuple. Then run all these on each input and throw away those inputs resulting in zero or too many tuples.
You should use a tool like Amazon Mechanical Turk for this. Human microtasking. Another alternative is to use a data entry freelancer. upWork is a great place to look. You can get excellent quality results and the cost is very reasonable for each.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Where can I get a list of easily parseable country codes and names? Note: 2 letter codes wanted. Examples:
au,Australia
uk,United Kingdom
us,United States
etc
The ISO 3166-1 list of country codes is what I was looking for.
For more information you can also find general information about country codes on Wikipedia and a - possibly more up to date list - ISO 3166-1 list as well.
Edit: Posting it here:
Country Name;ISO 3166-1-alpha-2 code
AFGHANISTAN;AF
ÅLAND ISLANDS;AX
ALBANIA;AL
ALGERIA;DZ
AMERICAN SAMOA;AS
ANDORRA;AD
ANGOLA;AO
ANGUILLA;AI
ANTARCTICA;AQ
ANTIGUA AND BARBUDA;AG
ARGENTINA;AR
ARMENIA;AM
ARUBA;AW
AUSTRALIA;AU
AUSTRIA;AT
AZERBAIJAN;AZ
BAHAMAS;BS
BAHRAIN;BH
BANGLADESH;BD
BARBADOS;BB
BELARUS;BY
BELGIUM;BE
BELIZE;BZ
BENIN;BJ
BERMUDA;BM
BHUTAN;BT
BOLIVIA, PLURINATIONAL STATE OF;BO
BONAIRE, SINT EUSTATIUS AND SABA;BQ
BOSNIA AND HERZEGOVINA;BA
BOTSWANA;BW
BOUVET ISLAND;BV
BRAZIL;BR
BRITISH INDIAN OCEAN TERRITORY;IO
BRUNEI DARUSSALAM;BN
BULGARIA;BG
BURKINA FASO;BF
BURUNDI;BI
CAMBODIA;KH
CAMEROON;CM
CANADA;CA
CAPE VERDE;CV
CAYMAN ISLANDS;KY
CENTRAL AFRICAN REPUBLIC;CF
CHAD;TD
CHILE;CL
CHINA;CN
CHRISTMAS ISLAND;CX
COCOS (KEELING) ISLANDS;CC
COLOMBIA;CO
COMOROS;KM
CONGO;CG
CONGO, THE DEMOCRATIC REPUBLIC OF THE;CD
COOK ISLANDS;CK
COSTA RICA;CR
CÔTE D'IVOIRE;CI
CROATIA;HR
CUBA;CU
CURAÇAO;CW
CYPRUS;CY
CZECH REPUBLIC;CZ
DENMARK;DK
DJIBOUTI;DJ
DOMINICA;DM
DOMINICAN REPUBLIC;DO
ECUADOR;EC
EGYPT;EG
EL SALVADOR;SV
EQUATORIAL GUINEA;GQ
ERITREA;ER
ESTONIA;EE
ETHIOPIA;ET
FALKLAND ISLANDS (MALVINAS);FK
FAROE ISLANDS;FO
FIJI;FJ
FINLAND;FI
FRANCE;FR
FRENCH GUIANA;GF
FRENCH POLYNESIA;PF
FRENCH SOUTHERN TERRITORIES;TF
GABON;GA
GAMBIA;GM
GEORGIA;GE
GERMANY;DE
GHANA;GH
GIBRALTAR;GI
GREECE;GR
GREENLAND;GL
GRENADA;GD
GUADELOUPE;GP
GUAM;GU
GUATEMALA;GT
GUERNSEY;GG
GUINEA;GN
GUINEA-BISSAU;GW
GUYANA;GY
HAITI;HT
HEARD ISLAND AND MCDONALD ISLANDS;HM
HOLY SEE (VATICAN CITY STATE);VA
HONDURAS;HN
HONG KONG;HK
HUNGARY;HU
ICELAND;IS
INDIA;IN
INDONESIA;ID
IRAN, ISLAMIC REPUBLIC OF;IR
IRAQ;IQ
IRELAND;IE
ISLE OF MAN;IM
ISRAEL;IL
ITALY;IT
JAMAICA;JM
JAPAN;JP
JERSEY;JE
JORDAN;JO
KAZAKHSTAN;KZ
KENYA;KE
KIRIBATI;KI
KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF;KP
KOREA, REPUBLIC OF;KR
KUWAIT;KW
KYRGYZSTAN;KG
LAO PEOPLE'S DEMOCRATIC REPUBLIC;LA
LATVIA;LV
LEBANON;LB
LESOTHO;LS
LIBERIA;LR
LIBYA;LY
LIECHTENSTEIN;LI
LITHUANIA;LT
LUXEMBOURG;LU
MACAO;MO
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF;MK
MADAGASCAR;MG
MALAWI;MW
MALAYSIA;MY
MALDIVES;MV
MALI;ML
MALTA;MT
MARSHALL ISLANDS;MH
MARTINIQUE;MQ
MAURITANIA;MR
MAURITIUS;MU
MAYOTTE;YT
MEXICO;MX
MICRONESIA, FEDERATED STATES OF;FM
MOLDOVA, REPUBLIC OF;MD
MONACO;MC
MONGOLIA;MN
MONTENEGRO;ME
MONTSERRAT;MS
MOROCCO;MA
MOZAMBIQUE;MZ
MYANMAR;MM
NAMIBIA;NA
NAURU;NR
NEPAL;NP
NETHERLANDS;NL
NEW CALEDONIA;NC
NEW ZEALAND;NZ
NICARAGUA;NI
NIGER;NE
NIGERIA;NG
NIUE;NU
NORFOLK ISLAND;NF
NORTHERN MARIANA ISLANDS;MP
NORWAY;NO
OMAN;OM
PAKISTAN;PK
PALAU;PW
PALESTINE, STATE OF;PS
PANAMA;PA
PAPUA NEW GUINEA;PG
PARAGUAY;PY
PERU;PE
PHILIPPINES;PH
PITCAIRN;PN
POLAND;PL
PORTUGAL;PT
PUERTO RICO;PR
QATAR;QA
RÉUNION;RE
ROMANIA;RO
RUSSIAN FEDERATION;RU
RWANDA;RW
SAINT BARTHÉLEMY;BL
SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA;SH
SAINT KITTS AND NEVIS;KN
SAINT LUCIA;LC
SAINT MARTIN (FRENCH PART);MF
SAINT PIERRE AND MIQUELON;PM
SAINT VINCENT AND THE GRENADINES;VC
SAMOA;WS
SAN MARINO;SM
SAO TOME AND PRINCIPE;ST
SAUDI ARABIA;SA
SENEGAL;SN
SERBIA;RS
SEYCHELLES;SC
SIERRA LEONE;SL
SINGAPORE;SG
SINT MAARTEN (DUTCH PART);SX
SLOVAKIA;SK
SLOVENIA;SI
SOLOMON ISLANDS;SB
SOMALIA;SO
SOUTH AFRICA;ZA
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS;GS
SOUTH SUDAN;SS
SPAIN;ES
SRI LANKA;LK
SUDAN;SD
SURINAME;SR
SVALBARD AND JAN MAYEN;SJ
SWAZILAND;SZ
SWEDEN;SE
SWITZERLAND;CH
SYRIAN ARAB REPUBLIC;SY
TAIWAN, PROVINCE OF CHINA;TW
TAJIKISTAN;TJ
TANZANIA, UNITED REPUBLIC OF;TZ
THAILAND;TH
TIMOR-LESTE;TL
TOGO;TG
TOKELAU;TK
TONGA;TO
TRINIDAD AND TOBAGO;TT
TUNISIA;TN
TURKEY;TR
TURKMENISTAN;TM
TURKS AND CAICOS ISLANDS;TC
TUVALU;TV
UGANDA;UG
UKRAINE;UA
UNITED ARAB EMIRATES;AE
UNITED KINGDOM;GB
UNITED STATES;US
UNITED STATES MINOR OUTLYING ISLANDS;UM
URUGUAY;UY
UZBEKISTAN;UZ
VANUATU;VU
VENEZUELA, BOLIVARIAN REPUBLIC OF;VE
VIETNAM;VN
VIRGIN ISLANDS, BRITISH;VG
VIRGIN ISLANDS, U.S.;VI
WALLIS AND FUTUNA;WF
WESTERN SAHARA;EH
YEMEN;YE
ZAMBIA;ZM
ZIMBABWE;ZW
Here's a maintained repo of country codes with friendly country names in multiple languages and in many formats, including text, CSV, JSON, YAML, XML, SQL, and others:
https://github.com/umpirsky/country-list
The English CSV dump from the above repo: https://github.com/umpirsky/country-list/blob/master/data/en_US/country.csv
In case it can help anyone, I just took the list of ISO 3166 country codes and names in English and French and put them together in CSV and SQL format: http://blog.plsoucy.com/2012/04/iso-3166-country-code-list-csv-sql/
While doing that, I fixed the capitalization so names aren't all uppercase, and renamed a few countries to the name that is used on Wikipedia, so "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF" became "Macedonia" for example. That should allow for shorter lists.
Feel free to use these if you want.
Take a look at ISO http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements.htm It is not CSV but you can easily copy and paste it into a file, or you can buy the file from ISO
updated the link