More > Media Center 12 (Development Ended)

Q: how to fill the NAME field with incrementing numbers?

<< < (2/2)

ShayB:
hi Marko,
The answers are very good, thanks.

It's just that every time I want to rename fields using this method (which later will be renaming the filename using those tags)
I have to remember the correct syntax.

I would like to use a right-click menu-like method. in which, when I right-click and select the correct item (say, pattern-renaming) I will have a regular-expression entry which I can then save as preset for later uses.

The whole thing came up actually, because I was trying to upload to my new Ipod the photos. Due to different sources, I got duplicates of the names so I had to make tham unique. So, to make it simple, I renamed the "name" field to become
[album] padnumber(counter(1),3)

since this is "constant" and can be applied to all lists I thought I can define an extra field and then just copy from field to field.

if there is an easiest way (not having the need to remember the count+pad syntex), I will "take it"  :)

Shay

marko:
I see.
The following will work for you...

make a library field called "Counter"
Make it "Calculated data" and use the expression =_padnumber(counter(1),3)
OK your way back out.

This field should not be used in any of your views, it's not meant to be seen.

Next time you want to batch renumber some files, select them, then use the steps outlined by myself and gappie, only now, you can enter any common string you want, followed by [counter] and the renumbering will take place as expected.

so, =Vacation_2008_padnumber(counter(1),3) would become =Vacation_2008[counter] and next time, you might want to choose =Christmas_2007[counter] and you'll get "Christmas_2007_001" etc. etc.

Caveats involved are minor...

1. If you run the [counter] field any time within five seconds of the last time, it will continue counting from where it left off last time.
2. It will always start from _001

Will that work for you?

-marko.

ShayB:
Thanks Marko,

This is a very good solution, I tried it.
at first I forgot to put the "=" so I picked again at your colored exampled

 :D

I wish it could be also done for the directory-renaming-expression
(I defined a field to compute where every file will go to but the rename tool changes the "\" with "_")
So I have to write the expression directly to the directory rule.

thanks,
Shay

gappie:

--- Quote from: marko on October 15, 2008, 12:47:13 pm ---
make a library field called "Counter"
Make it "Calculated data" and use the expression =_padnumber(counter(1),3)
OK your way back out.

--- End quote ---

lol.. really very nice. never thought about using a lib field that way.   :)

marko:

--- Quote from: ShayB on October 15, 2008, 02:20:12 pm ---I wish it could be also done for the directory-renaming-expression
(I defined a field to compute where every file will go to but the rename tool changes the "\" with "_")
So I have to write the expression directly to the directory rule.

thanks,
Shay

--- End quote ---
Crazy how you never stop learning with this software huh?

The quoted problem exists because the rename tool knows about Windows filenaming limitations, and in windows file names, a back slash is an illegal character. The rename tool checks these things before passing them on to any expression based rules contained within your instructions.

What this means is, that if you were to set up a library field that contained a folder path you wanted to use, the rename tool replaces the backslashes with underscores, and passes this info along as gospel. If you were to then wrap that info inside a replace() function, it would reverse the underscore replacement performed by the rename tool:

replace([field containing path],_,\)

-marko

Navigation

[0] Message Index

[*] Previous page

Go to full version