Author Topic: Find and replace multiple values in a folder  (Read 6149 times)

Offline fotobarone

  • Member
  • **
  • Posts: 62
    • View Profile
Find and replace multiple values in a folder
« on: January 20, 2020, 02:38:22 AM »
Hello, i need to delete the sequence number prior the filename of a collection of 200 photos and i wish i could avoid having to do it manually one by one.
Any solution?
I've tried the find and replace feature but i think it works with just one value at the time.
Thanks,

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Find and replace multiple values in a folder
« Reply #1 on: January 20, 2020, 07:40:22 AM »
Hello, i need to delete the sequence number prior the filename of a collection of 200 photos and i wish i could avoid having to do it manually one by one.
Any solution?
I've tried the find and replace feature but i think it works with just one value at the time.
Thanks,

You should be able to do that in bulk with the Rename Photos command.  If you'll give me a few sample filenames, I'll help you with the renaming parameters.

-Kirk

Offline fotobarone

  • Member
  • **
  • Posts: 62
    • View Profile
Re: Find and replace multiple values in a folder
« Reply #2 on: January 20, 2020, 08:35:49 AM »
Thanks, Kirk.
I know i can rename them, but i would like to keep the REAL original filename, that is the out of the camera filename. Since they have been renamed already, from let's say" _MK39206" (original filename) to "023-Marco e Silvia-_MK39206" now i wish i could get rid just of the number sequence, do you think it will be possible?
I mean, to remove the sequence number from a bunch of photos in bulk, let's say from 001 to 250.
Thanks,
« Last Edit: January 20, 2020, 10:54:51 AM by fotobarone »

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Find and replace multiple values in a folder
« Reply #3 on: January 20, 2020, 01:05:54 PM »
Thanks, Kirk.
I know i can rename them, but i would like to keep the REAL original filename, that is the out of the camera filename. Since they have been renamed already, from let's say" _MK39206" (original filename) to "023-Marco e Silvia-_MK39206" now i wish i could get rid just of the number sequence, do you think it will be possible?
I mean, to remove the sequence number from a bunch of photos in bulk, let's say from 001 to 250.

Yes, and I would need a representative sample in order to help you.  Please provide a variety of your filenames.

-Kirk

Offline fotobarone

  • Member
  • **
  • Posts: 62
    • View Profile
Re: Find and replace multiple values in a folder
« Reply #4 on: January 21, 2020, 12:27:40 AM »
In this case i have 257 images that come from several cameras, such as 3 Fuji XT bodies with original filenames as follow: _XTB****, _MK3**** and _CAX****, plus a DJI Mavic drone with filename DJI_***. During ingesting i applied a metadata template and also enabled the rename option {headline}-{filenamebase}, with the headline value "Marco e Silvia", so the filenames will be "Marco e Silvia-_XTB****" etc.
When all the photos have been edited i chose an order in which they should be displayed and then renamed them all with the variables {seqn}-{filenamebase} so that they became "001-Marco e Silvia-_XTB****" up to "257-Marco e Silvia-_XTB****".
Now i need to delete all sequence numbers from the filenames, but i wish to do it in batch, if possible. When i go to Find and replace i would like to have the option to find a range of values (in this case from 001 to 257) and replace them with a blank digit.
Also, another question: would it be possible to rename any photo leaving only the original out of the camera filename?
Many thanks!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Find and replace multiple values in a folder
« Reply #5 on: January 21, 2020, 09:35:01 AM »
In this case i have 257 images that come from several cameras, such as 3 Fuji XT bodies with original filenames as follow: _XTB****, _MK3**** and _CAX****, plus a DJI Mavic drone with filename DJI_***. During ingesting i applied a metadata template and also enabled the rename option {headline}-{filenamebase}, with the headline value "Marco e Silvia", so the filenames will be "Marco e Silvia-_XTB****" etc.
When all the photos have been edited i chose an order in which they should be displayed and then renamed them all with the variables {seqn}-{filenamebase} so that they became "001-Marco e Silvia-_XTB****" up to "257-Marco e Silvia-_XTB****".
Now i need to delete all sequence numbers from the filenames, but i wish to do it in batch, if possible. When i go to Find and replace i would like to have the option to find a range of values (in this case from 001 to 257) and replace them with a blank digit.

This will remove the first three letters of any filename:

{filenamebase:3}

Use it as your renaming string and it given "023-Marco e Silvia-_MK39206.ext" will produce "-Marco e Silvia-_MK39206.ext" as the renamed file (where 'ext' is the extension of the file (JPG, RAF, XMP, etc.)

If you want to eliminate the leading hyphen, use 4 instead of 3 in the above renaming string.

Here is the documentation: http://wiki.camerabits.com/en/index.php?title=User_Manual_Flat_View#Variable_Substring_Extraction

Also, another question: would it be possible to rename any photo leaving only the original out of the camera filename?

I don't understand what you're asking.  Please rephrase/provide initial name and desired name examples.

-Kirk

Offline fotobarone

  • Member
  • **
  • Posts: 62
    • View Profile
Re: Find and replace multiple values in a folder
« Reply #6 on: January 21, 2020, 10:30:07 AM »
Thanks Kirk, the {filenamebase:3} string worked great !!

Regarding the other question, i mean that i would like to restore the original filename as from EXIF datas of the camera, even if i had renamed it iin PM.
Example, if the original filename is _MK39206.ext, then i rename it to 023-Marco e Silvia-_MK39206.ext, how can i go back to its original filename?
In this case the {filenamebase:3} string would work only on selections of photos with the exact number of digits prior to it.
Thanks,

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Find and replace multiple values in a folder
« Reply #7 on: January 21, 2020, 12:55:39 PM »
Thanks Kirk, the {filenamebase:3} string worked great !!

Regarding the other question, i mean that i would like to restore the original filename as from EXIF datas of the camera, even if i had renamed it iin PM.
Example, if the original filename is _MK39206.ext, then i rename it to 023-Marco e Silvia-_MK39206.ext, how can i go back to its original filename?
In this case the {filenamebase:3} string would work only on selections of photos with the exact number of digits prior to it.
Thanks,

Not all cameras record the frame number in EXIF so for some cameras {frame4} could be used but it would fail on others.  But if your files had been named as you described earlier, you can use the same method of extracting portions of the filename for that purpose.  Please see the documentation.

-Kirk

Offline fotobarone

  • Member
  • **
  • Posts: 62
    • View Profile
Re: Find and replace multiple values in a folder
« Reply #8 on: January 22, 2020, 12:10:34 AM »
All clear, many thanks. Excellent support, Kirk.