Automating rename with multiple file extensions

Hi there :slight_smile:

I have made "dated backup buttons" as discussed in [Help with copy command, distguish between file and directory)

The thing is, I have a lot of files which have 2 extensions (as in file.tar.bz2). Using the functions as shown in that thread will rename the file to file.tar-2008-02-26.bz2.

Of course, this is not what I want. Could anybody point me towards a way around this, like setting the filename to everything before the first period and the extension being the whole last bit?

(Of course, that woul mess up files with names like application-v1.0.3.9.zip, but I have far fewer of these :slight_smile: )

TIA,
Anakha

Here you go (only the second line was changed):

Rename PATTERN="*" TO="* - {date|yyyy-MM-dd} {time|HH-mm-ss}" AUTORENAME TYPE=dirs Rename REGEXP PATTERN="([^.]+)\.(.*)" TO="\1 - {date|yyyy-MM-dd} {time|HH-mm-ss}.\2" AUTORENAME TYPE=files

Hmmm. I keep being surprised by how versatile DOpus is and how much more there is to know :smiley:

Thank you again Nudel!

/Anakha

Slight addition:

Rename REGEXP PATTERN="([^.]+)\.?(.*)" TO="\1-{date|yyyyMMdd}{time|HHmm}.\2" AUTORENAME TYPE=files

This will also rename files with no extension (I added a '?' after the . in the regexp)