More > Media Center 12 (Development Ended)
Q: how to fill the NAME field with incrementing numbers?
ShayB:
hi,
What is the easiest way to rename my photos such that they will have a pattern of strings and incrementing numbers?
(for example Vacation_2008_### where the ### are from 1 to some number according to a list of files that I generated)
gappie:
--- Quote from: ShayB on October 14, 2008, 01:36:32 pm ---hi,
What is the easiest way to rename my photos such that they will have a pattern of strings and incrementing numbers?
(for example Vacation_2008_### where the ### are from 1 to some number according to a list of files that I generated)
--- End quote ---
when you are looking at the list you have sorted select all the files you want to include and type in the name field (via the tag window or F2)
=Vacation_2008_Counter(1)
make a backup of the library first just to be sure and try a few first.
:)
gab
edit : more about the counter is here:
http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language#Counter.28....29:_Use_to_return_a_value_that_starts_at_one_and_counts_up_with_each_use
marko:
You want to populate the name field within MC, or do you want to change the actual file name?
If it's the former, then do as gappie suggests, though you might prefer to add some padding: =Vacation_2008_padnumber(counter(1),3)
This will give you _001 as opposed to simply _1
If on the other hand, you actually want to rename the files themselves, the process is very similar.
Right click on the tag window and choose "Also show > Filename (name)"
Select the files you wish to rename in the file list.
You will notice that the Filename (name) info in the tag window now says "Varies". Click that to edit and paste in: =Vacation_2008_padnumber(counter(1),3).[file type]
Press enter to apply the changes and MC will rename the files incrementally for you, updating the database with those new names at the same time.
Later, if you wish to add more files to the sequence, you can choose to start counting from any point you like. You do that by specifying the start number in brackets after the word 'counter'. In our examples we've asked MC to start counting from one.
If you're not happy, ctrl + z will revert your changes if you press them before making any other tag changes.
-marko.
ShayB:
thanks gappie, thanks marko,
I wish I could do the counting by using a user-field and then just copy from that field to the correct one.
Somehow, when I define a field that does the count calculations, Everytime that the cursor is moving on the entry the field of that entry is going wild (doing incrementation without stopping). I don't know if it's a bug or not.
Shay
marko:
counter() is not designed to be used like that I'm afraid.
When used in the way described, it's a wonderfully powerful and relatively simple tool to use, or at least, I think so!
In what way are our answers still leaving you short?
If we know that, then it's quite possible we may have some helpful tips up our sleeves for you.
-marko.
Navigation
[0] Message Index
[#] Next page
Go to full version