Given two lists of string elements list1
and list2
:
list1 = {"stel", "segw", "ma7", "str1"};
list2 = {
"agr: Agriculture, hunting, forestry, fishing",
"min: Mining and quarrying", "ma1: Food, beverages, tobacco",
"ma2: Textiles, textile products",
"ma3: Leather, leather products, footwear",
"ma4: Wood & products of wood and cork",
"ma5: Pulp, paper, paper products, printing, publishing",
"ma6: Coke, refined petroleum, nuclear fuel",
"ma7: Chemicals & chemical products",
"ma8: Rubber-plastics products",
"ma9: Other non-metallic mineral products",
"ma10: Manufacture of basic metals",
"ma11: Machinery-equipment n.e.c",
"ma12: Electrical equipment",
"ma13: Transport equipment",
"ma14: Manufacturing, nec; recycling",
"segw: Electricity, gas, water supply",
"scst: Construction",
"ma15: Sale-maintenance; repair-install. of mach. equip.",
"swhl: Wholesale trade, except motor vehicles",
"srtl: Retail trade, except of motor vehicles",
"shot: Hotels & restaurants", "str1: Inland transport",
"str2: Water transport",
"str3: Air transport",
"str4: Other supporting-transport act. of travel agencies",
"stel: Post & telecommunications",
"sfin: Financial intermediation",
"sest: Real estate activities",
"sbus: Renting of M&Eq and other business activities",
"sadm: Public adm.-defence;compulsory social security",
"sedu: Education",
"shlt: Human health-social work",
"soth: Other community, social & personal services"
};
I want to use list1
as the key to select the names
after :
in list2
. The selection should be in the order of list1
as follows:
answer = {
"Post & telecommunications",
"Electricity, gas, water supply",
"Chemicals & chemical products",
"Inland transport"
};