@echo poprefresh.btm refresh population figures from Wiki @echo off E: cd E:\com\mindprod\repair rem fetch and scrape https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population rem put resuts is pop.html scrapepopulation.exe rem triples country, pop, countryclone are now in pop.csv. Some countries will be missing. rem countrytoabbr.csv contains country to abbr translation rem translate country in col 0 to abbr CSVRecode.exe pop.csv countrytoabbr.csv -miss ?? 0 rem pop.csv now looks like DE,81770900,Germany rem some countries don't have an abbreviation. look like this --,240705,Abkhazia csvsort pop.csv 0s+ 2s+ rem get rid of the countries without 2-letter country codes. csvdedup pop.csv -delete 1 2 %edit pop.csv echo If pop.csv was fully populated with 2-char country appreviations, hit Y to carry on. echo if pop.csv is imperfect, hit N to abort, and patch countrytoabbr.csv to make sure all countries get a 2-char code or -- and restart. confirm.exe if errorlevel 1 exit E: cd \com\mindprod\repair copy moneyfacts.csv dual.csv rem country code, country, currcode, currency sign, decimal places, currency desc, flag, population csvreshape.exe dual.csv 0 1 2 3 4 5 6 7 0 rem country code, country, currcode, currency sign, decimal places, currency desc, flag, oldpop, country-code-clone rem replace country-code-clone with new population. CSVRecode.exe dual.csv pop.csv -miss 0 8 rem sort by new population rem sort unfixed with alpha codes to the end. We can't use a numeric sort. csvsort dual.csv 8s+ %edit dual.csv echo If dual.csv last column has plausible population, or you can patch them to such. 0=n/a hit Y to carry on. echo if dual.csv is imperfect, hit N to abort confirm.exe if errorlevel 1 exit rem drop oldpopulation, keep new population csvreshape.exe dual.csv 0 1 2 3 4 5 6 8 %edit dual.csv echo hit Y if ok to update the master moneyfacts.csv file confirm.exe copy dual.csv moneyfacts.csv if errorlevel 1 exit del dual.csv del pop.csv call proppopulationfacts.btm rem -30-