Use ChatGPT and PowerRename to Clean Up Date Prefixes
A receipt folder can contain both 2026-10-02_receipt_taxi.pdf and names that already use a compact date. ChatGPT can help plan the cleanup; Microsoft PowerToys PowerRename provides the preview and applies the changes. This guide converts YYYY-MM-DD_label to YYYYMMDD_label, keeping everything after the date separator, including extension capitalization, exactly as supplied.
Documentation checked October 20, 2026. The filenames below are a fictional worked example, not a report of a Windows or ChatGPT execution.
1. Start with a complete folder inventory
Make a copied test folder containing ordinary files only, with no subfolders. Keep the originals separately. Select individual files in this flat folder rather than selecting a folder for recursive processing. If needed, follow Microsoft’s PowerToys installation instructions and enable PowerRename.
Give ChatGPT the complete inventory of names in that folder and a separate list of the files you intend to select. Include files you will leave untouched: an unselected file can already occupy a proposed name. Use filename text only; this task needs neither receipt contents nor file creation dates.
Ask for a before/after table with status and reason. Require collision checks against the whole inventory and every proposed name, treating capitalization differences as collisions. Microsoft’s Windows naming guidance says not to assume names are case-sensitive. The reusable PowerRename planning prompt includes these constraints and asks for missing inventory before producing a plan.
2. Separate matching names from safe changes
Here is the complete six-file example. Assume all six are selected initially. A regex match alone does not make a rename safe: the train receipt has a target that already exists.
On a small screen, swipe the table to see every column.
| Original filename | Proposed filename | Status and reason |
|---|---|---|
2026-10-01_receipt_train.pdf |
20261001_receipt_train.pdf |
HOLD: target already exists; exclude source |
2026-10-02_receipt_taxi.pdf |
20261002_receipt_taxi.pdf |
READY: matching prefix, no collision |
2026-10-03_receipt_hotel.PDF |
20261003_receipt_hotel.PDF |
READY: uppercase extension preserved |
20261001_receipt_train.pdf |
Unchanged | UNCHANGED: already compact; occupies train target |
notes.pdf |
Unchanged | UNCHANGED: no date prefix |
2026-10-4_receipt_bus.pdf |
Unchanged | UNCHANGED: day is not two digits |
Only taxi and hotel should change. Keep the train pair untouched until you decide what those two files represent. Do not overwrite one, invent a replacement name, or accept an automatically numbered suffix as a resolution.
3. Enter the rule in PowerRename
Right-click the selected test files in File Explorer and open Rename with PowerRename. Microsoft’s PowerRename documentation explains its preview, capture groups, and filename scope.
- In Search for, enter
^([0-9]{4})-([0-9]{2})-([0-9]{2})_(.+)$. - In Replace with, enter
$1$2$3_$4. - Enable Use regular expressions and Match all occurrences. Choose Apply to: Filename only.
- Include files; turn folders and subfolders off. Leave text formatting unchanged and enumeration off. Check these settings explicitly, since previous choices may be restored.
The first three groups retain the year, month, and day digits; the fourth retains the nonempty label. With filename-only scope, the extension stays outside the replacement. This checks the prefix’s shape, not calendar validity: an impossible date such as 2026-99-99_label.pdf would still match. Review date meaning separately.
4. Check the actual preview, then apply
Compare the original and proposed columns row by row with your plan. Verify the actual rows are the intended regular files, regardless of the inclusion settings. Clear the train source’s checkbox to exclude that collision even though it matches. PowerRename does not receive ChatGPT’s HOLD status automatically.
Confirm that only taxi and hotel remain scheduled to change, with their suffixes and extensions intact. Recheck the folder inventory if anything has been added since planning. If the preview differs, stop and revise; use the same habit described in how to verify ChatGPT answers.
Apply the rename once, then inspect the files in Explorer. Explorer’s Undo Rename (Ctrl+Z) can undo the last rename operation; it is not a backup. Keep the originals until you have checked the copied result.
