ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: mickdugan on June 15, 2017, 02:33:49 PM

Title: File rename sequence - ignore extension?
Post by: mickdugan on June 15, 2017, 02:33:49 PM
Hi,

I'm renaming a sequence of files like this:

'-filename<CreationDate' -d %Y%m%d-01%%-.3nc-00.%%le

The only problem is that the sequence resets when the file type changes even though the actual filename is the same.

How can I ignore the extension when renaming with sequence?

Thanks!
Title: Re: File rename sequence - ignore extension?
Post by: Phil Harvey on June 15, 2017, 03:51:42 PM
You could try doing it in two steps:

1. exiftool '-filename<CreationDate' -d %Y%m%d-01%%-.3nc-00.xxx DIR

2. exiftool '-filename<%f.$filetypeextension' -ext xxx DIR

Of course, the second stage relies on ExifTool's file identification, so some extensions may change.

- Phil
Title: Re: File rename sequence - ignore extension?
Post by: mickdugan on June 15, 2017, 04:16:22 PM
Thanks. Although I'm not sure what that should do. I ran it but received an error.

Just to clarify, the problem is that I'm getting this:

20151225-01-001-00.mov
20151225-01-001-00.mp4
20151225-01-002-00.mov
20151225-01-003-00.mov

But I want this:

20151225-01-001-00.mov
20151225-01-002-00.mp4
20151225-01-003-00.mov
20151225-01-004-00.mov
Title: Re: File rename sequence - ignore extension?
Post by: Phil Harvey on June 15, 2017, 05:52:30 PM
What was the error?

The first command renames everthing to .xxx then the second changes the extensions back again.

- Phil