Library › Data AI › Finance and accounting
Convert messy money text into clean numbers in a CSV block
- For Finance and accounting
- You practice Showing an example of what you want
- Time about 5 minutes
- Level Beginner
About this exercise
An expense export has money typed many ways. Write one CSV block (one code block) with the header original,amount and one row per value, in the same order, where amount is a plain number with two decimals and no symbols or commas. Brackets mean negative, and n/a becomes an empty amount. At most 12 words outside the code.
Common mistakes when you ask AI for this
- Losing the minus sign. The AI reads (300.00) as positive 300.00. Try: Add: "Brackets mean negative: (300.00) -> -300.00."
- Putting 0 for n/a. The AI writes 0 or N/A, which the ledger would treat as real. Try: Add: "n/a -> leave amount empty."
- Keeping symbols and commas. $1,250.00 stays as typed or loses its decimals. Try: Add: "Two decimals, no $, no commas, 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
- Mentions brackets
- Handles n/a
- Asks for the header
- Gives the number format
- 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)