{"id":"data2-clean-messy-dates-csv-block","audience":"operations","category":"data","track":"data","technique":"format","level":"intermediate","title":"Clean a messy date column into ISO dates","free":false,"task":"Your CSV export has a messy 'received' column and you need clean dates. All dates are US format (month first). Write one CSV block (one code block) with the header original,clean and one row per value, where clean is YYYY-MM-DD, or the word unclear if the date is impossible or cannot be read. At most 15 words outside the code block.","materialLabel":"Messy values (attached to your prompt automatically)","material":"Column \"received\" from the vendor invoice export (Pinecrest Logistics), 10 values:\n\n1. 3/4/25\n2. 03-04-2025\n3. March 4, 2025\n4. 2025/03/04\n5. 13/04/25\n6. Mar 4th 25\n7. 02/30/2025\n8. 4 Mar 2025\n9. (blank)\n10. 3.4.25\n\nContext:\n- The vendor is in Ohio and the system exports US-style dates, month first, so 3/4/25 is March 4, 2025.\n- Value 5 starts with 13, which cannot be a month in US format.\n- February 2025 has 28 days.\n- A blank is a missing value, not a date.\n- Values are all from 2025.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":15}],"mistakes":[{"title":"Assuming day first","why":"The AI flips 3/4/25 to April 3 or guesses what 13/04/25 meant.","fix":"Add: \"US format, month first.\"","checks":["r0"]},{"title":"Guessing bad dates","why":"The AI repairs 02/30/2025 or 13/04/25 into a real date.","fix":"Add: \"Impossible dates and blanks: write unclear.\"","checks":["r1"]},{"title":"Wrong CSV shape","why":"The AI drops the header, reorders rows or adds columns.","fix":"Add: \"Header original,clean, then 10 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 15 words.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Names the format","patterns":["month first","us (format|style)","mm/dd"]},{"label":"Says what to do with bad dates","patterns":["unclear","impossible","don.t guess"]},{"label":"Names the output date style","patterns":["iso","yyyy-mm-dd"]},{"label":"Asks for a CSV block","patterns":["csv","code block","header"]},{"label":"Keeps row order","patterns":["same order","10 rows","one row per"]}],"hint":"AI will helpfully guess impossible dates. Tell it the format and what to write instead of guessing.","mission":"Clean the received dates into ISO format.","musts":["One CSV block","Month first","Unclear, not guessed"],"rubricLabels":["Values 1, 2, 3, 4, 6, 8 and 10 all convert to 2025-03-04","Values 5 (13/04/25), 7 (02/30/2025) and 9 (blank) are shown as unclear, not guessed (for example not 2025-04-13 or 2025-03-02)","The code block starts with the header original,clean and has 10 data rows in the original order, with no extra columns"]}