rename 5000 files with increase numbers with "P" at start

A swapping-ground for Regular Expression syntax

rename 5000 files with increase numbers with "P" at start

Postby mazuchi » Thu Jan 20, 2022 2:11 pm

hi everyone :D :D

i got files likes: 1.json - 2.json - 3.json - 4.json- .....
and i want : P001.json - P002.json - P003.json - P0004.json - .... :!:
mazuchi
 
Posts: 1
Joined: Thu Jan 20, 2022 1:42 pm

Prefix "P", then pad to 4-digits

Postby Luuk » Thu Jan 20, 2022 10:02 pm

If only wanting to conduct .json files? the Filters(12) should use a "Mask" like *.json
If wanting four digits? the Regex(1) needs a checkmark in "v2" with a 'Match' and 'Replace' like...

^(\d{1,4})$(?X)(\G(?!^)|^P)\K0(?=\d{4})/g
P000$1(?X)
Luuk
 
Posts: 692
Joined: Fri Feb 21, 2020 10:58 pm


Return to Regular Expressions


cron