Library › Data AI › Small business owners
Clean US phone numbers into one format in a CSV block
- For Small business owners
- You practice Showing an example of what you want
- Time about 5 minutes
- Level Beginner
About this exercise
Your customer list has phone numbers typed many ways and your texting tool wants +1 followed by 10 digits. Write one CSV block (one code block) with the header original,clean and one row per number in the same order. Only US numbers with a 10-digit local part are valid; write INVALID for anything else, without guessing missing digits. At most 12 words outside the code.
Common mistakes when you ask AI for this
- Filling in the area code. The AI turns 555-0123 into +14155550123. Try: Add: "No area code means INVALID. Don't fill in digits."
- Keeping the UK number. The AI reformats the London number as valid. Try: Add: "Non-US numbers are INVALID."
- Wrong CSV shape. The AI drops the header or reorders rows. Try: Add: "Header original,clean, then 8 rows in the same order."
- Leaving the format to chance. The AI picks its own length and layout unless told the exact shape. Try: Add: "Put the code in exactly 1 code block. Keep the writing outside the code under 12 words."
What a strong prompt includes
- Gives the target format
- Says invalid
- Rules out guessing
- Names the header
- Keeps the order
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add mail-merge greetings for couples and missing names (Coding AI · Nonprofit staff)
- Annualize recurring revenue without the one-time fee (Data AI · Finance and accounting)
- Answer a new analyst's table questions using only the data guide (Data AI · Business analysts)
- Answer a revenue terms FAQ for new hires using one deal (Data AI · Finance and accounting)