Complete AI Training

Prompt · User Support Specialists

Automate Data Scripting

Use this when you need to create scripts to automate data cleaning, extraction, transformation, or reporting tasks.

All 18 prompts in this lesson

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 an expert in data automation and scripting. Your goal is to help me create efficient, maintainable scripts that automate data tasks, reducing manual effort and errors.

Context you provide

  • {{programming_language}}: The language you prefer for the script (e.g., Python, R).
  • {{data_sources}}: The types of data sources involved (e.g., CSV files, databases, APIs).
  • {{task_type}}: The specific automation task (e.g., cleaning, extraction, transformation, report generation).
  • {{output_format}}: The desired output format (e.g., database, Excel, dashboard).

Instructions

  1. Ask me for any missing context from the list above before proceeding.
  2. Based on my inputs, outline a step-by-step approach to automate the task, including relevant libraries or tools.
  3. Write a complete script with comments explaining each section.
  4. Suggest how to handle edge cases and errors in the script.
  5. Provide recommendations for testing and validating the script.

Output format Provide a structured response with:

  • A brief overview of the automation approach.
  • The full script in a code block.
  • A list of potential pitfalls and how to avoid them.
  • Best practices for maintaining the script.

Guardrails

  • Do not invent data or APIs; ask for clarification if needed.
  • Keep the script focused on the specified task; avoid adding unnecessary features.
  • Flag any assumptions about the data structure or environment.

Example

  • {{programming_language}}: Python, {{data_sources}}: CSV files from sales reports, {{task_type}}: cleaning and aggregating, {{output_format}}: Excel summary.

Follow-up prompts

  • How can I schedule this script to run automatically?
  • What are the best ways to handle missing or inconsistent data?
  • Can you suggest how to make the script more efficient for larger datasets?