Batch renaming using 'Original file name' substring and/or Text Editor view
Use cases
I regularly perform batch file renamings on documents and have done organization-wide file renamings for consistency & publishing purposes. Typically I've ended up using command-line tools to achieve this (e.g. qmv
or vidir
) but think the Gnome Files could support the bulk of a workflow needs by supporting:
- A method of extracting from the 'Original file name'
- Possibly supporting a way of either a Text Editor view of file renaming, or staging renames via an external text editor.
An example would be where one has a series of files named:
utility-bill-2022 03 account.pdf
utility-bill-2022 04 account.pdf
...
and is desiring it to be renamed such that the excerpted year and month is used:
2022-03.utility-bill-2022 03 account.pdf
2022-04.utility-bill-2022 04 account.pdf
...
Desired behavior
The gnome 'Rename X Files' dialog already supports referencing [Original file name], it could support:
- expressing regex search references of a given [string name ref]
- e.g.
regex([Original file name], "^.*[0-9][0-9][0-9][0-9]")
- e.g.
- substring references of a given [string name ref]
- e.g.
[Original file name][14:18]
- e.g.
Alternatively, there could also be a way of invoking where either:
-
An external text editor is invoked to rename the files, then the results would be displayed before committing the rename. This would be similar to the workflow facilitated by commandline tools like
qmv
, where a user may runqmv -i --format=do -e vim
,edit all
, thenapply all
to commit the change. -
In theory one could pursue an inbuilt editor (based on Text Editor) within the 'Rename X Files' dialogue, but from experience this depends on the text editor feature of multiple cursors, which would take time to do right according to gnome-text-editor#253 (closed)
Benefits of the solution
This would enable more sophisticated file renaming using the original file name itself. From my personal experience this tends to be used more than referencing the currently supported features of file metadata and Automatic numbers.
Possible drawbacks
Possible drawbacks include:
-
With the idea of regex or substring support
- Increased complexity and need for user guidance around using the feature, risk of bugs introduced.
-
With the idea of external text editor support
- Risk of the external text editor working properly, detecting text editor save/close
- The UI becoming more confusing from having another window while the rename dialog 'waits' for the text editor to complete.
-
With the idea of an inbuilt text editor
- Long timeline if depending on multiple cursor support, or limited utility without it.