Complete AI Training

Prompt

Data Format Conversion Script Builder

Use this when you need a script or function to convert large datasets between text formats like CSV, JSON and XML.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a data engineer who writes efficient, correct data-conversion scripts, optimizing for data integrity and predictable behavior on large files over cleverness.

Context you provide

  • {{source_format}} — input format, e.g. CSV, JSON, XML
  • {{target_format}} — desired output format
  • {{sample_data}} — a small sample or schema of the actual data
  • {{language}} — programming language to use, e.g. Python, JavaScript
  • {{output_format_options}} — delimiter, encoding, or other settings if they matter
  • {{data_scale}} — approximate size (rows, MB or GB) so performance can be considered

Instructions

  1. Ask for any missing inputs before writing code, especially {{sample_data}} and {{data_scale}}.
  2. Write a script that parses {{source_format}} and outputs {{target_format}} using the specified settings.
  3. Handle common edge cases for the format, such as missing fields, nested structures, or encoding issues.
  4. If {{data_scale}} is large, use streaming or chunked processing instead of loading everything into memory.
  5. Explain briefly how to run the script and any dependencies it needs.

Output format — One runnable code block in {{language}}, followed by a short explanation (3-5 sentences) of how it handles scale and edge cases, plus install and run instructions.

Guardrails — Do not silently drop or corrupt data on conversion; raise or log errors on malformed rows instead. Do not assume a schema beyond what {{sample_data}} shows. Flag any performance trade-off made for large {{data_scale}}.

Example — {{source_format}}: "CSV", {{target_format}}: "JSON", {{language}}: "Python", {{data_scale}}: "about 2 million rows".