Nautilus - Find and replace text - operations on numbers
I'm using Ubuntu 18.04.2, Nautilus 3.26.4
Trying to rename a selected group of files that contain a number in the file name, e.g.:
"Scanned 2019-06-10 18-40 (10) ok.jpg"
"Scanned 2019-06-10 18-40 (11) acceptable.jpg"
"Scanned 2019-06-10 18-40 (23) good.jpg"
"Scanned 2019-06-10 18-40 (24) ok.jpg"
"Scanned 2019-06-10 18-40 (11) ok.jpg"
"Scanned 2019-06-10 18-40 (12) acceptable.jpg"
"Scanned 2019-06-10 18-40 (24) good.jpg"
"Scanned 2019-06-10 18-40 (25) ok.jpg"
Introducing an additional syntax for "Find and replace text", in Nautilus - the
Existing text: "Scanned 2019-06-10 18-40 (
Replace with: "Scanned 2019-06-10 18-40 (
@ can be used in the
Existing text as a number wildcard
i can be used in the
Replace with and represents what
@ represents for each filename
i can be accessed only in an arithmetic expression; an arithmetic expression is delimited by a
only the first
@ encountered in the
Existing text term should be considered a wildcard (its content will be denoted by the variable
i, that can be used in an arithmetic expression)
Benefits of the solution
This syntax could be useful for example for renaming a large number of scanned pages at once (for example ".jpg" files scanned with a scanner device) (an inexact replace - meaning that the
search term varies because for each filename it contains a different number)
In order to keep it simple, only one
@ wildcard and the variable
i (that represents what
@ represents for each filename) can be used
@ could be either a wildcard or a plain character, when it is a plain character it has to be escaped with
\ (\@), and because
\ could be either an escape character or a plain character - when it is a plain character it has to be escaped with