{"id":"data2-country-names-to-iso-csv","audience":"operations","category":"data","track":"data","technique":"examples","level":"intermediate","title":"Convert messy country names into ISO codes in a CSV block","free":false,"task":"Your customer export has country names typed many ways and the billing tool needs two-letter ISO codes. Write one CSV block (one code block) with the header original,iso2 and one row per value in the same order. Use the official ISO code (the United Kingdom is GB, not UK), and write UNKNOWN for anything that isn't a real country. At most 12 words outside the code.","materialLabel":"Country values as typed (attached to your prompt automatically)","material":"Country field from the signup form - Fernhill Software (8 values)\n\n1. USA\n2. u.s.\n3. United States of America\n4. UK\n5. Great Britain\n6. Deutschland\n7. Holland\n8. Atlantis\n\nContext:\n- The form had a free-text box instead of a dropdown, which is why the values vary.\n- The billing tool rejects any code that is not on the ISO 3166-1 two-letter list.\n- Holland is a common informal name for the Netherlands.\n- Row order must stay the same so the codes can be pasted back next to the originals.\n- Atlantis was typed as a joke by one user.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":12}],"mistakes":[{"title":"Writing UK","why":"UK is common but not an ISO code, so the billing tool rejects it.","fix":"Add: \"The United Kingdom is GB, not UK.\"","checks":["r0"]},{"title":"Inventing a code","why":"The AI gives Atlantis a made-up code.","fix":"Add: \"If it isn't a real country, write UNKNOWN.\"","checks":["r1"]},{"title":"Wrong CSV shape","why":"The AI drops the header or reorders rows.","fix":"Add: \"Header original,iso2, then 8 rows in the same order.\"","checks":["r2"]},{"title":"Leaving the format to chance","why":"The AI picks its own length and layout unless told the exact shape.","fix":"Add: \"Put the code in exactly 1 code block. Keep the writing outside the code under 12 words.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Names ISO codes","patterns":["iso","two.letter"]},{"label":"Fixes UK","patterns":["gb","not uk"]},{"label":"Says what to do with fakes","patterns":["unknown"]},{"label":"Names the header","patterns":["original,iso2","header"]},{"label":"Keeps the order","patterns":["same order","8 rows"]}],"hint":"The classic trap is UK versus GB. Name it, and say what to do with non-countries.","mission":"Convert these country names to ISO codes.","musts":["One CSV block","GB not UK","Unknown for Atlantis"],"rubricLabels":["Rows 1, 2 and 3 all map to US, and rows 4 and 5 both map to GB (not UK)","Row 6 maps to DE, row 7 maps to NL, and row 8 (Atlantis) is UNKNOWN","The code block is CSV with the header original,iso2 and 8 rows in the original order, with the original text copied exactly"]}