and you want to rename them by removing all parts apart from FIRSTNAME, LASTNAME andFIRSTNAME.LASTNAME.119399697_INPROGRESS_DHM PICKLIST.REPORT20191024_100516.txt
FIRSTNAME.LASTNAME.119399698_INPROGRESS_DHM PICKLIST.REPORT20191024_100517.jpg
FIRSTNAME.LASTNAME.119399699_INPROGRESS_DHM PICKLIST.REPORT20191024_100518.mkv
the ascending number before the extension. Additionally we want to replace all used
separators (dots, underscores) with a single one, e.g. a hyphen.
The resulting names should be:
This would require a regex rename in XY...FIRSTNAME-LASTNAME-100516.txt
FIRSTNAME-LASTNAME-100517.jpg
FIRSTNAME-LASTNAME-100518.mkv
To make things a bit easier I wrote this little script. It is a "define the parts to keep" from a file/
folder name. It throws away all other parts. File extensions are retained. It's nothing more
than a little regexp pattern / remove part generator...
It requires a two step process. In the first one you need to enter the separator(s) that are used to
chop the names into parts. These separators are remembered between each call of the script.
The script assumes that all selected files / folders are named using the same pattern (= have
the same separators and the same number of parts. File extensions don't count as a part).
You can define a single separator to use in the final output if you add a trailing "|" to the input,
followed by the separator you need.
E.g. for the above we would use
.,_|-
...
In the second step you're entering the numbers of the blocks you want to keep, separatedby commas. E.g. for the above example we would need to use:
1,2,7
...
v0.4 supports a delete block(s) syntax, e.g.: -2,-4
...A mix of both syntaxes is not allowed!
The result would look like this: Current version: Old version(s): Version history:
/*
@Changelog:
+++ major new feature
+ new feature
* changed feature
- removed feature
% improved performance
! fixed minor bug
!!! fixed major bug
v0.4
+ Support for a delete part(s) syntax. Prefix ALL numbers with a "-".
E.g.: -2,-4
A mixed syntax (keep AND delete) is NOT allowed.
v0.3
+ Support for replacing all separators with a single one. E.g. you could
replace all hyphens and underscores with a dot, etc.
v0.2
+ Support for multiple separators. Enter them with either a comma or a
semicolon between them! E.g.: to use a dot, a hyphen and an underscore,
enter:
a.) .,-,_
or
b.) .;-;_
The order of the entered separators does NOT matter!
v0.1
• Initial release
*/