Python Prompts Free Prompt

Python Script to Rename Files in Bulk with Pattern

Write a Python script to rename multiple files in a folder using a pattern
☆ Save
Prompt
You are a Python automation expert. Write a script that renames files in a folder according to a pattern (e.g., add prefix, change extension, replace text). The script must: 1) Accept folder path and pattern options, 2) Support dry-run to preview changes, 3) Handle recursive renaming, 4) Use regular expressions for complex patterns, 5) Log changes, 6) Provide undo functionality (rename back), 7) Include error handling for name conflicts. Add comments and examples.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.