Quote:
Originally Posted by zimpt
I want to merge all those epubs. But because sorting by "Title" it sorts digit after digit instead of the whole number I thought it would be the best to add leading zeroes so the chapters are in the right order
|
@BetterRed's suggestion is best, but you can get what you want by checking
the option Preferences / Behavior / Recognize numbers inside text when sorting.
With the option unchecked:
With the option checked:
You can also use a bulk search & replace with source "template" to change the titles to have a fixed number of leading zeros This is complicated and error prone so I don't recommend it. The template would be something like this, assuming that the number always appears at the end and that it can be floating point:
Code:
program:
text = re($title, '^(.*?)[\d\.]*$', '\1');
digits = re($title, '.*?((\d+(?:\.\d*)?|\.\d+)).*?', '\1');
digits = format_number(digits, '08.2f');
title = text & digits