Renaming a file with an sequence number and a given start value

Started by Archive, May 12, 2010, 08:54:34 AM

Previous topic - Next topic

Archive

[Originally posted by thefrog on 2009-04-23 05:11:58-07]

After reading all the 'renaming' post I send you this request:
With the tag '%.c' I can set a sequence number for the new filenames, starting with '0' (%.4c) or '1' (%-.4nc).
Is there a possibility to start with a given value like '253' ?
regards, urs

Archive

[Originally posted by exiftool on 2009-04-23 11:04:49-07]

hi urs,  there is currently no option to
start numbering at an arbitrary value.
I can think of no simple way to do this
right now. - Phil

Archive

[Originally posted by thefrog on 2009-04-23 13:37:22-07]

Hi Phil
I was expecting this answer somehow ;-)
Nevertheless: I know the renaming tool 'PFrank' is able to do that and also 'IrfanView', but I like your ExifTool better, and working with meta data, I feel much safer with your tool than with others like ACDSee Pro.

Perhaps, I have to describe my entire issue:
- I get pictures from several cameras
- I store all this pictures together in one directory per year
- I like a chronological filename for all files in this directory,
  e.g. 'YYYYMMDD_counter_project.jpg'
  I like an sequence number over all files, it is easier to see the order in other applications

There are now the following issues:
- (minor) possible identical filenames from the different cameras when moving all the files into one directory
- to create such a sequence number, all the files must be sorted by date first, then the renaming/numbering can start

Today, I use IrfanView for this task. First, I copy all the files into one directory, rename them to 'YYYYMMDD_HHMMSS.jpg' to ensure the chronological order,
and then rename the files again by replacing the time part 'HHMMSS' with my sequence number.
And it would be much easier if there was a script which can do all this steps for me ;-)

How are other people work with pictures from several cameras? Do I have to change my workflow?

Archive

[Originally posted by thefrog on 2009-04-23 13:45:54-07]

(lost the formatting in the last answer )

Hi Phil I was expecting this answer somehow ;-)
 
Nevertheless: I know the renaming tool 'PFrank' is able to do that and also 'IrfanView', but I like your ExifTool better, and working with meta data, I feel much safer with your tool than with others like ACDSee Pro.

Perhaps, I have to describe my entire issue:
 
- I get pictures from several cameras

- I store all this pictures together in one directory per year

- I like a chronological filename for all files in this directory, e.g. 'YYYYMMDD_counter_project.jpg'

 - I like an sequence number over all files, it is easier to see the order of the picturs in other applications

There are now the following issues:

- (minor) possible identical filenames from the different cameras when moving all the files into one directory

- to create such a sequence number, all the files must be sorted by date first, then the renaming/numbering can start

Today, I use IrfanView for this task. First, I copy all the files into one directory, rename them to 'YYYYMMDD_HHMMSS.jpg' to ensure the chronological order, and then rename the files again by replacing the time part 'HHMMSS' with my sequence number.

It would be much easier if there was a script which can do all this steps for me ;-)

How are other people work with pictures from several cameras? Do I have to change my workflow?

Archive

[Originally posted by exiftool on 2009-04-23 23:36:03-07]

I'm on vacation right now but I can think about
how this could be done when I get back in May. - Phil

Archive

[Originally posted by thefrog on 2009-04-24 04:23:45-07]

Thank you very much for your answer and I wish you a good time. urs

Archive

[Originally posted by exiftool on 2009-05-04 12:43:13-07]

Hi Urs,

I have thought about this question.

One real problem doing this with exiftool is that the order the files
are processed is not defined (although most operating systems
will return them in alphabetical order, this is not guaranteed).
This makes it difficult to implement a feature like this which
is platform independent.  If it weren't for this problem, it could
be implemented with a bit of pain via a user-defined tag in
exiftool, although the result wouldn't be ideal because you would
have to edit the config file to set the starting number each time.

Probably the best thing to do is to write a simple script in your
favourite language to do the renaming, then the starting number
could be input on the command line.  This would be a trivial
exercise in Perl or any Unix shell script, but I'm not a Windows
expert so I don't know how it would be done in a .NET language
or a .BAT file.

- Phil

Archive

[Originally posted by thefrog on 2009-05-05 05:06:06-07]

Hi Phil

I haven't realized the platform independent problem, I was too much concentrated on my problem.
I will write a two task script like you proposed, and with your Exiftool the main work is already done.

- regards, urs