Hi
Bit tricky trying to ask for help with something not knowing the correct terminology.
I have a number of files with a prefix number with same file extension.
I want to keep the numbers and file extension and maybe add something more meaningful between numbers and extension.
Example
1234567 Name of file variable in length with file extension.
and
123456 only with file extension.
What would work for these?
Thanks
Smokes
Tricky to try and explain
Re: Tricky to try and explain
Hi,
Using regular expressions it is quite easy.
Use the following expression:
(\d+).*\.([^\.]+)
and the following new name template:
$1.$2
To keep only the number prefix and the extension
if you want to put additional text in the new name, you can put it after the $1
$1 and $2 matche the blocks between parenthesis
\d = number
+ = 1 or more
* = 0 or more
. = any character
\. = an actual dot character
[^\.] = anything except a dot
Using regular expressions it is quite easy.
Use the following expression:
(\d+).*\.([^\.]+)
and the following new name template:
$1.$2
To keep only the number prefix and the extension
if you want to put additional text in the new name, you can put it after the $1
$1 and $2 matche the blocks between parenthesis
\d = number
+ = 1 or more
* = 0 or more
. = any character
\. = an actual dot character
[^\.] = anything except a dot