javascript - Sorting country list alphabeticaly -


this question has answer here:

i coded following list based on countries 2 letter code

now boss whats country names in alphetical order. i'm start manually love know if there easy/quick way based on have already.

<div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button"     data-toggle="dropdown">country list <span class="caret"></span></button> <ul style="height: 450px; overflow: auto;" class="dropdown-menu"> <li><a href="#" onclick="showdiv('ad')">andorra</a></li> <li><a href="#" onclick="showdiv('ag')">antigua , barbuda</a></li> <li><a href="#" onclick="showdiv('ai')">anguilla</a></li> <li><a href="#" onclick="showdiv('al')">albania</a></li> <li><a href="#" onclick="showdiv('am')">armenia</a></li> <li><a href="#" onclick="showdiv('aq')">antarctica</a></li> <li><a href="#" onclick="showdiv('ar')">argentina</a></li> <li><a href="#" onclick="showdiv('at')">austria</a></li> <li><a href="#" onclick="showdiv('au')">australia</a></li> <li><a href="#" onclick="showdiv('ax')">aland islands</a></li> <li><a href="#" onclick="showdiv('az')">azerbaijan</a></li> <li><a href="#" onclick="showdiv('ba')">bosnia , herzegovina</a></li> <li><a href="#" onclick="showdiv('bb')">barbados</a></li> <li><a href="#" onclick="showdiv('bd')">bangladesh</a></li> <li><a href="#" onclick="showdiv('be')">belgium</a></li> <li><a href="#" onclick="showdiv('bf')">burkina faso</a></li> <li><a href="#" onclick="showdiv('bg')">bulgaria</a></li> <li><a href="#" onclick="showdiv('bi')">burundi</a></li> <li><a href="#" onclick="showdiv('bj')">benin</a></li> <li><a href="#" onclick="showdiv('bl')">saint barthélemy</a></li> <li><a href="#" onclick="showdiv('bm')">bermuda</a></li> <li><a href="#" onclick="showdiv('bn')">brunei darussalam</a></li> <li><a href="#" onclick="showdiv('bo')">bolivia, plurinational state of</a></li> <li><a href="#" onclick="showdiv('br')">brazil</a></li> <li><a href="#" onclick="showdiv('bs')">bahamas</a></li> <li><a href="#" onclick="showdiv('bt')">bhutan</a></li> <li><a href="#" onclick="showdiv('bv')">bouvet island</a></li> <li><a href="#" onclick="showdiv('bw')">botswana</a></li> <li><a href="#" onclick="showdiv('by')">belarus</a></li> <li><a href="#" onclick="showdiv('ca')">canada</a></li> <li><a href="#" onclick="showdiv('cc')">cocos (keeling) islands</a></li> <li><a href="#" onclick="showdiv('cd')">congo, democratic republic of the</a></li> <li><a href="#" onclick="showdiv('cf')">central african republic</a></li> <li><a href="#" onclick="showdiv('cg')">congo</a></li> <li><a href="#" onclick="showdiv('ch')">switzerland</a></li> <li><a href="#" onclick="showdiv('ci')">côte d'ivoire</a></li> <li><a href="#" onclick="showdiv('ck')">cook islands</a></li> <li><a href="#" onclick="showdiv('cl')">chile</a></li> <li><a href="#" onclick="showdiv('cm')">cameroon</a></li> <li><a href="#" onclick="showdiv('cn')">china</a></li> <li><a href="#" onclick="showdiv('co')">colombia</a></li> <li><a href="#" onclick="showdiv('cr')">costa rica</a></li> <li><a href="#" onclick="showdiv('cv')">cape verde</a></li> <li><a href="#" onclick="showdiv('cx')">christmas island</a></li> <li><a href="#" onclick="showdiv('cy')">cyprus</a></li> <li><a href="#" onclick="showdiv('cz')">czech republic</a></li> <li><a href="#" onclick="showdiv('de')">germany</a></li> <li><a href="#" onclick="showdiv('dj')">djibouti</a></li> <li><a href="#" onclick="showdiv('dk')">denmark</a></li> <li><a href="#" onclick="showdiv('dm')">dominica</a></li> <li><a href="#" onclick="showdiv('do')">dominican republic</a></li> <li><a href="#" onclick="showdiv('ec')">ecuador</a></li> <li><a href="#" onclick="showdiv('ee')">estonia</a></li> <li><a href="#" onclick="showdiv('eg')">egypt</a></li> <li><a href="#" onclick="showdiv('eh')">western sahara</a></li> <li><a href="#" onclick="showdiv('es')">spain</a></li> <li><a href="#" onclick="showdiv('fi')">finland</a></li> <li><a href="#" onclick="showdiv('fj')">fiji</a></li> <li><a href="#" onclick="showdiv('fk')">falkland islands (malvinas)</a></li> <li><a href="#" onclick="showdiv('fm')">micronesia, federated states of</a></li> <li><a href="#" onclick="showdiv('fo')">faroe islands</a></li> <li><a href="#" onclick="showdiv('fr')">france</a></li> <li><a href="#" onclick="showdiv('ga')">gabon</a></li> <li><a href="#" onclick="showdiv('gb')">united kingdom</a></li> <li><a href="#" onclick="showdiv('gd')">grenada</a></li> <li><a href="#" onclick="showdiv('ge')">georgia</a></li> <li><a href="#" onclick="showdiv('gf')">french guiana</a></li> <li><a href="#" onclick="showdiv('gg')">guernsey</a></li> <li><a href="#" onclick="showdiv('gh')">ghana</a></li> <li><a href="#" onclick="showdiv('gi')">gibraltar</a></li> <li><a href="#" onclick="showdiv('gl')">greenland</a></li> <li><a href="#" onclick="showdiv('gm')">gambia</a></li> <li><a href="#" onclick="showdiv('gn')">guinea</a></li> <li><a href="#" onclick="showdiv('gp')">guadeloupe</a></li> <li><a href="#" onclick="showdiv('gq')">equatorial guinea</a></li> <li><a href="#" onclick="showdiv('gr')">greece</a></li> <li><a href="#" onclick="showdiv('gt')">guatemala</a></li> <li><a href="#" onclick="showdiv('gu')">guam</a></li> <li><a href="#" onclick="showdiv('gw')">guinea-bissau</a></li> <li><a href="#" onclick="showdiv('gy')">guyana</a></li> <li><a href="#" onclick="showdiv('hk')">hong kong</a></li> <li><a href="#" onclick="showdiv('hm')">heard island , mcdonald islands</a></li> <li><a href="#" onclick="showdiv('hn')">honduras</a></li> <li><a href="#" onclick="showdiv('hr')">croatia</a></li> <li><a href="#" onclick="showdiv('ht')">haiti</a></li> <li><a href="#" onclick="showdiv('hu')">hungary</a></li> <li><a href="#" onclick="showdiv('id')">indonesia</a></li> <li><a href="#" onclick="showdiv('ie')">ireland</a></li> <li><a href="#" onclick="showdiv('im')">isle of man</a></li> <li><a href="#" onclick="showdiv('in')">india</a></li> <li><a href="#" onclick="showdiv('io')">british indian ocean territory</a></li> <li><a href="#" onclick="showdiv('ir')">iran, islamic republic of</a></li> <li><a href="#" onclick="showdiv('is')">iceland</a></li> <li><a href="#" onclick="showdiv('it')">italy</a></li> <li><a href="#" onclick="showdiv('je')">jersey</a></li> <li><a href="#" onclick="showdiv('jm')">jamaica</a></li> <li><a href="#" onclick="showdiv('jp')">japan</a></li> <li><a href="#" onclick="showdiv('ke')">kenya</a></li> <li><a href="#" onclick="showdiv('kg')">kyrgyzstan</a></li> <li><a href="#" onclick="showdiv('kh')">cambodia</a></li> <li><a href="#" onclick="showdiv('ki')">kiribati</a></li> <li><a href="#" onclick="showdiv('km')">comoros</a></li> <li><a href="#" onclick="showdiv('kn')">saint kitts , nevis</a></li> <li><a href="#" onclick="showdiv('kp')">korea, democratic people's republic of</a></li> <li><a href="#" onclick="showdiv('kr')">korea, republic of</a></li> <li><a href="#" onclick="showdiv('ky')">cayman islands</a></li> <li><a href="#" onclick="showdiv('kz')">kazakhstan</a></li> <li><a href="#" onclick="showdiv('la')">lao people's democratic republic</a></li> <li><a href="#" onclick="showdiv('lb')">lebanon</a></li> <li><a href="#" onclick="showdiv('lc')">saint lucia</a></li> <li><a href="#" onclick="showdiv('li')">liechtenstein</a></li> <li><a href="#" onclick="showdiv('lk')">sri lanka</a></li> <li><a href="#" onclick="showdiv('ls')">lesotho</a></li> <li><a href="#" onclick="showdiv('lt')">lithuania</a></li> <li><a href="#" onclick="showdiv('lu')">luxembourg</a></li> <li><a href="#" onclick="showdiv('lv')">latvia</a></li> <li><a href="#" onclick="showdiv('ly')">libya</a></li> <li><a href="#" onclick="showdiv('ma')">morocco</a></li> <li><a href="#" onclick="showdiv('mc')">monaco</a></li> <li><a href="#" onclick="showdiv('md')">moldova, republic of</a></li> <li><a href="#" onclick="showdiv('me')">montenegro</a></li> <li><a href="#" onclick="showdiv('mg')">madagascar</a></li> <li><a href="#" onclick="showdiv('mk')">macedonia, former yugoslav republic of</a></li> <li><a href="#" onclick="showdiv('ml')">mali</a></li> <li><a href="#" onclick="showdiv('mm')">myanmar</a></li> <li><a href="#" onclick="showdiv('mn')">mongolia</a></li> <li><a href="#" onclick="showdiv('mo')">macao</a></li> <li><a href="#" onclick="showdiv('mp')">northern mariana islands</a></li> <li><a href="#" onclick="showdiv('mq')">martinique</a></li> <li><a href="#" onclick="showdiv('ms')">montserrat</a></li> <li><a href="#" onclick="showdiv('mu')">mauritius</a></li> <li><a href="#" onclick="showdiv('mv')">maldives</a></li> <li><a href="#" onclick="showdiv('mw')">malawi</a></li> <li><a href="#" onclick="showdiv('mx')">mexico</a></li> <li><a href="#" onclick="showdiv('my')">malaysia</a></li> <li><a href="#" onclick="showdiv('mz')">mozambique</a></li> <li><a href="#" onclick="showdiv('na')">namibia</a></li> <li><a href="#" onclick="showdiv('nc')">new caledonia</a></li> <li><a href="#" onclick="showdiv('ne')">niger</a></li> <li><a href="#" onclick="showdiv('ng')">nigeria</a></li> <li><a href="#" onclick="showdiv('ni')">nicaragua</a></li> <li><a href="#" onclick="showdiv('no')">norway</a></li> <li><a href="#" onclick="showdiv('np')">nepal</a></li> <li><a href="#" onclick="showdiv('nr')">nauru</a></li> <li><a href="#" onclick="showdiv('nu')">niue</a></li> <li><a href="#" onclick="showdiv('nz')">new zealand</a></li> <li><a href="#" onclick="showdiv('pa')">panama</a></li> <li><a href="#" onclick="showdiv('pe')">peru</a></li> <li><a href="#" onclick="showdiv('pf')">french polynesia</a></li> <li><a href="#" onclick="showdiv('pg')">papua new guinea</a></li> <li><a href="#" onclick="showdiv('ph')">philippines</a></li> <li><a href="#" onclick="showdiv('pk')">pakistan</a></li> <li><a href="#" onclick="showdiv('pl')">poland</a></li> <li><a href="#" onclick="showdiv('pm')">saint pierre , miquelon</a></li> <li><a href="#" onclick="showdiv('pn')">pitcairn</a></li> <li><a href="#" onclick="showdiv('pr')">puerto rico</a></li> <li><a href="#" onclick="showdiv('pt')">portugal</a></li> <li><a href="#" onclick="showdiv('pw')">palau</a></li> <li><a href="#" onclick="showdiv('py')">paraguay</a></li> <li><a href="#" onclick="showdiv('qa')">qatar</a></li> <li><a href="#" onclick="showdiv('re')">réunion</a></li> <li><a href="#" onclick="showdiv('ro')">romania</a></li> <li><a href="#" onclick="showdiv('rs')">serbia</a></li> <li><a href="#" onclick="showdiv('ru')">russian federation</a></li> <li><a href="#" onclick="showdiv('sa')">saudi arabia</a></li> <li><a href="#" onclick="showdiv('sb')">solomon islands</a></li> <li><a href="#" onclick="showdiv('se')">sweden</a></li> <li><a href="#" onclick="showdiv('sg')">singapore</a></li> <li><a href="#" onclick="showdiv('sh')">saint helena, ascension , tristan da cunha</a></li> <li><a href="#" onclick="showdiv('si')">slovenia</a></li> <li><a href="#" onclick="showdiv('sj')">svalbard , jan mayen</a></li> <li><a href="#" onclick="showdiv('sk')">slovakia</a></li> <li><a href="#" onclick="showdiv('sl')">sierra leone</a></li> <li><a href="#" onclick="showdiv('sm')">san marino</a></li> <li><a href="#" onclick="showdiv('sn')">senegal</a></li> <li><a href="#" onclick="showdiv('sr')">suriname</a></li> <li><a href="#" onclick="showdiv('ss')">south sudan</a></li> <li><a href="#" onclick="showdiv('st')">sao tome , principe</a></li> <li><a href="#" onclick="showdiv('sv')">el salvador</a></li> <li><a href="#" onclick="showdiv('sx')">sint maarten (dutch part)</a></li> <li><a href="#" onclick="showdiv('sy')">syrian arab republic</a></li> <li><a href="#" onclick="showdiv('sz')">swaziland</a></li> <li><a href="#" onclick="showdiv('tc')">turks , caicos islands</a></li> <li><a href="#" onclick="showdiv('td')">chad</a></li> <li><a href="#" onclick="showdiv('tf')">french southern territories</a></li> <li><a href="#" onclick="showdiv('tg')">togo</a></li> <li><a href="#" onclick="showdiv('th')">thailand</a></li> <li><a href="#" onclick="showdiv('tj')">tajikistan</a></li> <li><a href="#" onclick="showdiv('tk')">tokelau</a></li> <li><a href="#" onclick="showdiv('tl')">timor-leste</a></li> <li><a href="#" onclick="showdiv('tm')">turkmenistan</a></li> <li><a href="#" onclick="showdiv('to')">tonga</a></li> <li><a href="#" onclick="showdiv('tr')">turkey</a></li> <li><a href="#" onclick="showdiv('tt')">trinidad , tobago</a></li> <li><a href="#" onclick="showdiv('tv')">tuvalu</a></li> <li><a href="#" onclick="showdiv('tw')">taiwan, province of china</a></li> <li><a href="#" onclick="showdiv('tz')">tanzania, united republic of</a></li> <li><a href="#" onclick="showdiv('ua')">ukraine</a></li> <li><a href="#" onclick="showdiv('ug')">uganda</a></li> <li><a href="#" onclick="showdiv('um')">united states minor outlying islands</a></li> <li><a href="#" onclick="showdiv('uy')">uruguay</a></li> <li><a href="#" onclick="showdiv('uz')">uzbekistan</a></li> <li><a href="#" onclick="showdiv('va')">holy see (vatican city state)</a></li> <li><a href="#" onclick="showdiv('vc')">saint vincent , grenadines</a></li> <li><a href="#" onclick="showdiv('ve')">venezuela, bolivarian republic of</a></li> <li><a href="#" onclick="showdiv('vn')">viet nam</a></li> <li><a href="#" onclick="showdiv('vu')">vanuatu</a></li> <li><a href="#" onclick="showdiv('wf')">wallis , futuna</a></li> <li><a href="#" onclick="showdiv('ws')">samoa</a></li> <li><a href="#" onclick="showdiv('yt')">mayotte</a></li> <li><a href="#" onclick="showdiv('za')">south africa</a></li> <li><a href="#" onclick="showdiv('zm')">zambia</a></li> <li><a href="#" onclick="showdiv('zw')">zimbabwe</a></li> 

any tips great. thanks.

using excel break apart blocks of code, sort or insert other data, put together!

1) split code block columns

  • copy code block excel, go data tab "text columns"
  • select "fixed width", , drag slider edge of country names (i working fast here, use delimiter)
  • hit "finish"
  • select column b , hit "home tab" "sort , filter" - sort a-z saying "yes" expand selection

2) put again (concatenate)

  • go column on far right , click first empty cell (c)...
  • hit "formulas", "text", "concactenate"
  • select cols , b , hit "ok"
  • double click corner of formulae copy bottom of sheet

3) remember formulas output not yet "copyable" so...

  • select output, copy , go next column , hit "paste values"
  • then copy column other program , done

that's in nutshell, technique worth learning, have "concatenation" sheets use sorts of jobs :)


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -