how invert components of names, viz AB > BA

To enable sorting by date, where name is unfortunately month_year, ( eg 02_2024) I need to rename

02_2024.pdf to 2024_02.pdf

This must often be needed. Can neither figure nor find how!

In hope

M

Reply to #1:
Hello!

One way to do that:
o-- Add a batch method of the type "Replace"
o-- For "Replace:" paste in ]\b(\d{2})_(\d{4})\b[ . . . but without the ][
o-- For "Replace with:", use: $2_$1
o-- Make sure "Use regular expressions" is checked.

That should do what you want.

For an explanation of that regex, see: https://regex101.com/r/kSeTPV/1

Regards,
Randy
Reply to #2:

Hi gentlemen,

If the filenames are JUST like "02_2024.ext", in other words just a date and extension, you can use a SWAP method.

Separator: _
Occurrence: 1st
Apply to: Name

User guide: https://www.advancedrenamer.com/user_guide/v4/method_swap

In any other situation Randy's way is the way to go.

Best,
DF