Page 1 of 1

Advanced renaming syntax

Posted: 01.10.2019, 10:03
by CabbageTree
Hi there,

I wonder, whether is there a way how to automatically put a zero in front of single digit in the end of the file. When I have file named like this:
  • File_1.png
  • File_2.png
  • File_3.png
  • File_4.png
  • File_10.png
  • File_11.png
  • File_12.png
When I want the file to be numbered by two digits, I have to manually pick the 1—9 and rename them by search & replace. This works, but feels kind of manual. I also cannot just renumber the files automatically from scratch, because they cannot be sorted appropriately either by name or time.

Is there some advanced syntax for this, even if the length of the filename is variable, but the numbers are the last?

Thanks for any ideas…

Re: Advanced renaming syntax

Posted: 05.10.2019, 17:26
by Dreamer
If you have the same number of non-digit characters, it's possible, if not, it would be harder, or impossible, but it would be easier with exact example.

You can use Natural sorting option to sort such files in correct order.

Anyway, I think this could be quite useful feature, I will start a new topic.

Re: Advanced renaming syntax

Posted: 07.10.2019, 19:49
by stephen147
If you're looking for a regular expression to use in the rename dialog use something like this:

Replace:
(?!0)(\d)(?!\d)$

Replace with:
0$1

Tick the exclude extension checkbox.

Full explanation here: https://regex101.com/r/k2CCDD/1

Just save it as a preset and Bobs your uncle.

Re: Advanced renaming syntax

Posted: 18.10.2019, 16:10
by CabbageTree
Wow!

Thank you both guys!

Re: Advanced renaming syntax

Posted: 04.11.2019, 17:55
by Marek
In the last release 806, if you want replace any number at the end of the file name, you can use:
Search for: [0-9]+\Z
Replace with: [c]
"Regular expression" - active
"Exclude extension" - active

Re: Advanced renaming syntax

Posted: 05.11.2019, 00:14
by Dreamer
Thanks, Marek, it will be just not easy to find.

Added to "FreeCommander XE "not so obvious" settings" topic.