Data Cleaning Using Prompt Engineering

When working with messy datasets or mixed information tables, you might need to extract specific details — like email addresses — from the clutter.
In this article, we’ll demonstrate how to use a simple AI prompt to clean your data and extract emails only, without needing any technical background.

We’ll begin with a sample of disorganized data for 15 fictional people, then include the

Example: Unstructured Data for 15 People:

1. Name: Olivia Thompson | Position: Marketing Manager | Address: New York, USA | Email: olivia.t.marketing@gmail.com | Phone: +1-212-555-7832  
2. Name: Jack Robinson | Position: Software Developer | Address: London, UK | Email: jack.dev.rob@hotmail.co.uk | Phone: +44-7911-123456  
3. Name: Emily Carter | Position: HR Director | Address: Sydney, Australia | Email: emily.c@corp.au | Phone: +61-412-334455  
4. Name: Daniel Wright | Position: Data Analyst | Address: Toronto, Canada | Email: daniel.wright@analytics.ca | Phone: +1-647-800-1122  
5. Name: Sophia Evans | Position: Graphic Designer | Address: Dublin, Ireland | Email: sophia.e.design@freelance.ie | Phone: +353-85-5566778  
6. Name: Benjamin Scott | Position: Accountant | Address: Wellington, New Zealand | Email: ben.scott@finance.nz | Phone: +64-21-987654  
7. Name: Ava Hill | Position: UX Designer | Address: San Francisco, USA | Email: ava.ux@creativelab.com | Phone: +1-415-789-8877  
8. Name: James Anderson | Position: IT Support Specialist | Address: Manchester, UK | Email: j.anderson@supporthub.uk | Phone: +44-7456-443322  
9. Name: Mia Lewis | Position: Sales Executive | Address: Vancouver, Canada | Email: mia.sales.ca@gmail.com | Phone: +1-604-901-2244  
10. Name: Ethan Harris | Position: Network Administrator | Address: Glasgow, Scotland | Email: ethan.netadmin@techmail.uk | Phone: +44-7745-558899  
11. Name: Lily Martin | Position: Content Writer | Address: Melbourne, Australia | Email: lily.writer@content.au | Phone: +61-488-667788  
12. Name: Noah Walker | Position: Project Manager | Address: Boston, USA | Email: noah.pm@enterprise.com | Phone: +1-617-321-9870  
13. Name: Chloe Moore | Position: Digital Strategist | Address: Berlin, Germany | Email: chloe.strategy@aihub.de | Phone: +49-171-9911223  
14. Name: Lucas Turner | Position: Legal Advisor | Address: Paris, France | Email: lucas.law@legalmail.fr | Phone: +33-6-98765432  
15. Name: Grace King | Position: Event Coordinator | Address: Amsterdam, Netherlands | Email: grace.events@organize.nl | Phone: +31-6-33445566 

Prompt: Extract Only Email Addresses

Use the following prompt in any AI tool, then paste the data above. The result will be a clean list of just the email addresses — no code or formatting required.

You are a data extraction assistant. From the following messy or unstructured list of people’s data, extract only the email addresses. Ignore all other fields. Return the emails as a clean bullet-point list. Do not include any explanation or extra text — just the emails.

Here is the data:
[Paste your data here]

Expected Output (Example)

olivia.t.marketing@gmail.com

jack.dev.rob@hotmail.co.uk

emily.c@corp.au

daniel.wright@analytics.ca

sophia.e.design@freelance.ie

ben.scott@finance.nz

ava.ux@creativelab.com

j.anderson@supporthub.uk

mia.sales.ca@gmail.com

ethan.netadmin@techmail.uk

lily.writer@content.au

noah.pm@enterprise.com

chloe.strategy@aihub.de

lucas.law@legalmail.fr

grace.events@organize.nl