You may use the
batch rename tool, and fix these names from PDF Explorer itself.
For the above name examples, a script like this:
function Fixname() {
//remove path
var filename = BatchFile.Filename.substring(BatchFile.Filename.lastIndexOf('\\') + 1);
//remove extension
filename = filename.substring(0, filename.lastIndexOf('.'));
var fParts = filename.split('_');
if (fParts.length == 2) {
var v1 = parseInt(fParts[0]);
var v2 = parseInt(fParts[1]);
if (v1 != NaN && v2 != NaN) {
return lPad(v1, 5) + '_' + lPad(v2, 4);
}
}
return filename
}
function lPad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
can be used by this tool to fix these names easily.
Select all the files that need to be checked, even the ones with correct names, and start the batch rename tool. Now click the right pointing arrow button at the right of the rename formula field, and, from the popup menu, click the item "Scripts>ManageScripts".
Now create a new script and name it
Fixname, and paste the above script in the script editor (check the first attached screenshot how it should look like). Close the editor, saving the changes.
In the renamer tool, make reference to that function in the "rename formula" field by typing the function name inclosed in square brackets, i.e.
[Fixname]. Visually check if all the new names are correct, and run it.
If indeed you want to use the column method you proposed, you may use the
Edit Info Fields batch tool for this.
Just set a custom field to hold this value, by creating a
custom grid layout, to properly name, and include, a custom field in the grid). Now start the edit info field batch tool, selecting all the files you want to process, enable the field you will use to hold the value, and, as in the above example, start the script manager and create a
NameLength named script:
function NameLength() {
//remove path
var filename = BatchFile.Filename.substring(BatchFile.Filename.lastIndexOf('\\') + 1);
//remove extension
filename = filename.substring(0, filename.lastIndexOf('.'));
return filename.length;
}
Close, saving it, and back on the edit info fields tool make reference to that function by typing
[NameLength] in that custom field. Tick also the "DB only" checkbox, in order to update the column only in the database (it's a working column, so no need to edit the value in the PDF itself).
Run the tool, and you will have now that custom field column showing the length of the filenames, you can then use to sort and export to a csv file.