1# Clean and prepare messy data | Codex use cases1---
2name: Clean and prepare messy data
3tagline: Process tabular data without affecting the original.
4summary: Drag in or mention a messy CSV or spreadsheet, describe the problems
5 you see, and ask ChatGPT to write a cleaned copy while keeping the original
6 file unchanged.
7skills:
8 - token: $spreadsheet
9 description: Inspect tabular files, clean columns, and produce reviewable outputs.
10bestFor:
11 - CSV or spreadsheet exports with mixed dates, currencies, duplicates, summary
12 rows, or missing values.
13 - Teams who work with data from multiple sources.
14starterPrompt:
15 title: Clean a Copy
16 body: >-
17 Clean @marketplace-risk-rollout-export.csv.
2 18
3Codex use cases
4 19
520 What's wrong:
6 21
722 - dates are mixed between MM/DD/YYYY and YYYY-MM-DD
8 23
9Codex use case24 - currency values include $, commas, and blank cells
10 25
11# Clean and prepare messy data26 - a few duplicate customer rows came from repeated exports
12 27
13Process tabular data without affecting the original.28 - region and category names use several aliases
14 29
15Difficulty **Easy**30 - there are pasted summary rows mixed into the data
16 31
17Time horizon **5m**
18 32
19Drag in or mention a messy CSV or spreadsheet, describe the problems you see, and ask Codex to write a cleaned copy while keeping the original file unchanged.33 What I want:
20 34
21## Best for35 - write a cleaned CSV
22 36
23- CSV or spreadsheet exports with mixed dates, currencies, duplicates, summary rows, or missing values.37 - keep the original file unchanged
24- Teams who work with data from multiple sources.
25 38
26# Contents39 - use one date format
27 40
28[← All use cases](https://developers.openai.com/codex/use-cases)41 - keep blank currency cells blank
29 42
30Copy page [Export as PDF](https://developers.openai.com/codex/use-cases/clean-messy-data/?export=pdf)43 - preserve source row IDs when possible
31 44
32Drag in or mention a messy CSV or spreadsheet, describe the problems you see, and ask Codex to write a cleaned copy while keeping the original file unchanged.45 - add a short data-quality note with rows you changed, removed, or could not
33 46 clean confidently
34Easy47 suggestedEffort: low
35 48relatedLinks:
365m49 - label: Analyze data with ChatGPT
37 50 url: /codex/use-cases/analyze-data-export
38Related links51 - label: File inputs
39 52 url: /api/docs/guides/file-inputs
40[Analyze data with Codex](https://developers.openai.com/codex/use-cases/analyze-data-export) [File inputs](https://developers.openai.com/api/docs/guides/file-inputs) [Agent skills](https://developers.openai.com/codex/skills)53 - label: Agent skills
41 54 url: /codex/build-skills
42## Best for55---
43
44- CSV or spreadsheet exports with mixed dates, currencies, duplicates, summary rows, or missing values.
45- Teams who work with data from multiple sources.
46
47## Skills & Plugins
48
49- Spreadsheet
50
51 Inspect tabular files, clean columns, and produce reviewable outputs.
52
53| Skill | Why use it |
54| --- | --- |
55| Spreadsheet | Inspect tabular files, clean columns, and produce reviewable outputs. |
56
57## Starter prompt
58
59Clean @marketplace-risk-rollout-export.csv.
60What's wrong:
61- dates are mixed between MM/DD/YYYY and YYYY-MM-DD
62- currency values include $, commas, and blank cells
63- a few duplicate customer rows came from repeated exports
64- region and category names use several aliases
65- there are pasted summary rows mixed into the data
66What I want:
67- write a cleaned CSV
68- keep the original file unchanged
69- use one date format
70- keep blank currency cells blank
71- preserve source row IDs when possible
72- add a short data-quality note with rows you changed, removed, or could not clean confidently
73
74Open in the Codex app
75
76Clean @marketplace-risk-rollout-export.csv.
77What's wrong:
78- dates are mixed between MM/DD/YYYY and YYYY-MM-DD
79- currency values include $, commas, and blank cells
80- a few duplicate customer rows came from repeated exports
81- region and category names use several aliases
82- there are pasted summary rows mixed into the data
83What I want:
84- write a cleaned CSV
85- keep the original file unchanged
86- use one date format
87- keep blank currency cells blank
88- preserve source row IDs when possible
89- add a short data-quality note with rows you changed, removed, or could not clean confidently
90 56
91## Introduction57## Introduction
92 58
93Codex is great at cleaning systematically tabular data.59ChatGPT is great at cleaning systematically tabular data.
94When a CSV or spreadsheet has mixed dates, duplicate rows, currency strings, blank cells, aliases, or pasted summary rows, ask Codex to clean a copy and leave the original file unchanged.60When a CSV or spreadsheet has mixed dates, duplicate rows, currency strings, blank cells, aliases, or pasted summary rows, ask ChatGPT to clean a copy and leave the original file unchanged.
95
96[
97Your browser does not support the video tag.
98](https://cdn.openai.com/codex/docs/developers-website/use-cases/data-analysis-cleaning-csv.mp4)
99 61
100## How to use62## How to use
101 63
1021. Drag the file into Codex or mention it in your prompt, such as `@customer-export.csv`.
1032. Describe the problems you already see.
1043. Tell Codex what the cleaned version should be: CSV, spreadsheet tab, or upload-ready file.
1054. Review the cleaned copy before using it.
106
107Use the starter prompt on this page for the first cleaning pass. Replace the file name and bullets with your own. The useful details are the problems you already see and the file you need next: a cleaned CSV, a clean spreadsheet tab, or an upload-ready file. After Codex writes the clean copy, open the cleaned file and the data-quality note from the thread before using the data downstream.
108
109## Related use cases
110
111[
112
113### Query tabular data
114 64
115Use Codex with a CSV, spreadsheet, dashboard export, Google Sheet, or local data file to...
116 65
117Data Knowledge Work](https://developers.openai.com/codex/use-cases/analyze-data-export)[661. Drag the file into ChatGPT or mention it in your prompt, such as `@customer-export.csv`.
118 672. Describe the problems you already see.
119### Turn feedback into actions683. Tell ChatGPT what the cleaned version should be: CSV, spreadsheet tab, or upload-ready file.
120 694. Review the cleaned copy before using it.
121Connect Codex to multiple data sources such as Slack, GitHub, Linear, or Google Drive to...
122
123Data Integrations](https://developers.openai.com/codex/use-cases/feedback-synthesis)[
124
125### Forecast cash flow
126 70
127Give Codex cash-flow inputs and model constraints, then ask it to create an editable...
128 71
129Data Knowledge Work](https://developers.openai.com/codex/use-cases/cash-flow-forecast)
130 72
73Use the starter prompt on this page for the first cleaning pass. Replace the file name and bullets with your own. The useful details are the problems you already see and the file you need next: a cleaned CSV, a clean spreadsheet tab, or an upload-ready file. After ChatGPT writes the clean copy, open the cleaned file and the data-quality note from the task before using the data downstream.