Author Topic: Removing characters from file name  (Read 11308 times)

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Removing characters from file name
« on: January 27, 2007, 11:37:14 AM »
Greetings

Using Nikon D2X, my files are automatically named: _DSC001.JPG, etc.

Although there are some options in the camera to change the filenaming setup, how can I use PhotoMechanic to remove the underscore at the beginning of the filenames?

For example:
     _DSC001.JPG would become

     DSC001.JPG

or, ideally, in lowercase
     dsc001.jpg


Thank aforethought,

folsombob

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Removing characters from file name
« Reply #1 on: January 27, 2007, 01:07:05 PM »
folsombob,

Using Nikon D2X, my files are automatically named: _DSC001.JPG, etc.

Although there are some options in the camera to change the filenaming setup, how can I use PhotoMechanic to remove the underscore at the beginning of the filenames?

For example:
     _DSC001.JPG would become

     DSC001.JPG

or, ideally, in lowercase
     dsc001.jpg

Set the sequence number to 001 before you rename.  To do this, select "Set Sequence Variable..." from the Edit menu.  Change it to 001 and click the OK button.

In the Preferences dialog, click on the Files tab and select the radio button titled "Use lowercase extensions (.jpg, .tiff, etc.)".  Then click the OK button.

Now that you have your settings all setup (you won't have to do the first two steps again) you can rename your photos.

Select all of your photos and then open the Rename Photos dialog.

Use this as your renaming string:

dsc{seqn}

Click the Rename button.

That's it.

Now usually it would be better to use a more descriptive name, including things like the date it was shot, the job you shot, etc.  But what I explained will do what you want to do.

HTH,

-Kirk

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Removing characters from file name
« Reply #2 on: January 27, 2007, 07:08:57 PM »
Hi, Kirk

That does help, however, I wanted to preserve the original filenames/numbering and only remove the underscore that prefaces each filename.

So, _DSC001.JPG, and _DSC004.JPG, and _DSC023.JPG,
would become dsc001.jpg, dsc004, jpg, and dsc023. jpg, etc.

I am of the opinion that this type of "purging" (for lack of a better expression) is not possible.

Thanks,

folsombob

folsombob,

Using Nikon D2X, my files are automatically named: _DSC001.JPG, etc.

Although there are some options in the camera to change the filenaming setup, how can I use PhotoMechanic to remove the underscore at the beginning of the filenames?

For example:
     _DSC001.JPG would become

     DSC001.JPG

or, ideally, in lowercase
     dsc001.jpg

Set the sequence number to 001 before you rename.  To do this, select "Set Sequence Variable..." from the Edit menu.  Change it to 001 and click the OK button.

In the Preferences dialog, click on the Files tab and select the radio button titled "Use lowercase extensions (.jpg, .tiff, etc.)".  Then click the OK button.

Now that you have your settings all setup (you won't have to do the first two steps again) you can rename your photos.

Select all of your photos and then open the Rename Photos dialog.

Use this as your renaming string:

dsc{seqn}

Click the Rename button.

That's it.

Now usually it would be better to use a more descriptive name, including things like the date it was shot, the job you shot, etc.  But what I explained will do what you want to do.

HTH,

-Kirk


Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Removing characters from file name
« Reply #3 on: January 27, 2007, 10:25:48 PM »
That does help, however, I wanted to preserve the original filenames/numbering and only remove the underscore that prefaces each filename.

So, _DSC001.JPG, and _DSC004.JPG, and _DSC023.JPG,
would become dsc001.jpg, dsc004, jpg, and dsc023. jpg, etc.

I am of the opinion that this type of "purging" (for lack of a better expression) is not possible.

Version 4.5 allows substring manipulation and would be capable of doing all but lowercasing your names for you.

The renaming string I gave you will do exactly what you're asking for.  Maybe not the way you were wanting it to work, but the end result is the same.

-Kirk

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Removing characters from file name
« Reply #4 on: January 27, 2007, 11:56:15 PM »
Hello, again, Kirk

I should have mentioned that I am using the Windows 4.4.3.3 version.

Perhaps it is different than the Macintosh version -- if that is what you are refering to, plus I don't have v.4.5

So, it may be a mute point with me not having v.4.5, but I don't understand how the string you gave me would keep the original filename while only removing the underscore at the beginning.

The way I understand you, dsc{seqn} will make the filenames dsc001, dsc002, dsc003, etc, but I want to keep the original names and not renumber them.

Thanks,

folsombob

That does help, however, I wanted to preserve the original filenames/numbering and only remove the underscore that prefaces each filename.

So, _DSC001.JPG, and _DSC004.JPG, and _DSC023.JPG,
would become dsc001.jpg, dsc004, jpg, and dsc023. jpg, etc.

I am of the opinion that this type of "purging" (for lack of a better expression) is not possible.

Version 4.5 allows substring manipulation and would be capable of doing all but lowercasing your names for you.

The renaming string I gave you will do exactly what you're asking for.  Maybe not the way you were wanting it to work, but the end result is the same.

-Kirk


Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Removing characters from file name
« Reply #5 on: January 28, 2007, 01:38:14 AM »
I should have mentioned that I am using the Windows 4.4.3.3 version.

Perhaps it is different than the Macintosh version -- if that is what you are refering to, plus I don't have v.4.5

Version 4.5 is still in development.

Quote from: folsombob
So, it may be a mute point with me not having v.4.5, but I don't understand how the string you gave me would keep the original filename while only removing the underscore at the beginning.

The way I understand you, dsc{seqn} will make the filenames dsc001, dsc002, dsc003, etc, but I want to keep the original names and not renumber them.

That's true, but in the example you gave me your filenames were in sequential order anyway.  Here is how you can do what you want:

dsc{frame}

That should preserve the frame numbers when you rename.

HTH,

-Kirk

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Removing characters from file name
« Reply #6 on: January 28, 2007, 11:15:45 PM »
Hi, Kirk

Well, something's amiss.

I did as you suggested, using:

dsc{frame}

but all that did was change _DSC001.JPG, and _DSC004.JPG, and _DSC023.JPG

to dsc.jpg, dscA.jpg, dscB.jpg

Again, I am using Windows 4.4.3.3, so maybe it doesn't work in this version.

Thanks, though.

folsombob



I should have mentioned that I am using the Windows 4.4.3.3 version.

Perhaps it is different than the Macintosh version -- if that is what you are refering to, plus I don't have v.4.5

Version 4.5 is still in development.

Quote from: folsombob
So, it may be a mute point with me not having v.4.5, but I don't understand how the string you gave me would keep the original filename while only removing the underscore at the beginning.

The way I understand you, dsc{seqn} will make the filenames dsc001, dsc002, dsc003, etc, but I want to keep the original names and not renumber them.

That's true, but in the example you gave me your filenames were in sequential order anyway.  Here is how you can do what you want:

dsc{frame}

That should preserve the frame numbers when you rename.

HTH,

-Kirk


Offline Kevin M. Cox

  • Hero Member
  • *****
  • Posts: 511
  • PM 6 (7102) | macOS 14.4.1
    • View Profile
    • Kevin M. Cox | Photojournalist
Re: Removing characters from file name
« Reply #7 on: January 29, 2007, 08:53:06 PM »
folsombob, I just tested this with PM 4.4.3.3 on both Windows XP SP2 and OS X 10.4.8 using the following six files. All were shot as JPEGS in a Canon EOS 1D Mark II N.  I used the renaming string: "kmc{frame}"

_KMC3933.jpg
_KMC3934.jpg
_KC17571.jpg
_KC17572.jpg
_KC17595.jpg
_KC17596.jpg

On both platforms the files were renamed just as expected:

kmc3933.jpg
kmc3934.jpg
kmc7571.jpg
kmc7572.jpg
kmc7595.jpg
kmc7596.jpg

Maybe it is a problem with how the D2X embeds the frame info into the file?
Kevin M. Cox | Photojournalist
https://www.instagram.com/kevin.m.cox/

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24763
    • View Profile
    • Camera Bits, Inc.
Re: Removing characters from file name
« Reply #8 on: January 29, 2007, 09:46:52 PM »
folsombob, I just tested this with PM 4.4.3.3 on both Windows XP SP2 and OS X 10.4.8 using the following six files. All were shot as JPEGS in a Canon EOS 1D Mark II N.  I used the renaming string: "kmc{frame}"

_KMC3933.jpg
_KMC3934.jpg
_KC17571.jpg
_KC17572.jpg
_KC17595.jpg
_KC17596.jpg

On both platforms the files were renamed just as expected:

kmc3933.jpg
kmc3934.jpg
kmc7571.jpg
kmc7572.jpg
kmc7595.jpg
kmc7596.jpg

Maybe it is a problem with how the D2X embeds the frame info into the file?

Looking more closely at the filenames he listed shows that they only have three digits instead of the usual four.  Folsombob, how did you filenames end up with only three digits?

-Kirk

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Removing characters from file name
« Reply #9 on: January 30, 2007, 12:01:49 AM »
Hi, Kirk

I just discovered the problem. For some reason -- and I am not sure right now -- PhotoShop was renaming the files with an added underscore to the beginning of the existing filename when I did a batch action such as resizing, etc.

The default naming scheme of Nikon D2X is _DSC####.JPG (four numbers); thus the resulting filename would become __DSC####.JPG (note the added "_")

When I was attempting to use your method of dsc{frame} it would not work because of the added "_".

After a few trials and multiple errors, I ended up the the sequence I had previously posted:  dsc.jpg, dscA.jpg, dscB.jpg, etc.

Because I was only testing a few files, I simply renamed them dsc001.jpg, dsc004.jpg, dsc012.jpg, etc., omitting the first zero and ending up with a number frame of three, rather than four.

So, I finally started over and copying some of the original files into a "test" folder and ran your dsc{frame} again and voila -- success!!!

Thanks, Kirk, for your persistence. This will be of a great help to me!

folsombob

folsombob, I just tested this with PM 4.4.3.3 on both Windows XP SP2 and OS X 10.4.8 using the following six files. All were shot as JPEGS in a Canon EOS 1D Mark II N.  I used the renaming string: "kmc{frame}"

_KMC3933.jpg
_KMC3934.jpg
_KC17571.jpg
_KC17572.jpg
_KC17595.jpg
_KC17596.jpg

On both platforms the files were renamed just as expected:

kmc3933.jpg
kmc3934.jpg
kmc7571.jpg
kmc7572.jpg
kmc7595.jpg
kmc7596.jpg

Maybe it is a problem with how the D2X embeds the frame info into the file?

Looking more closely at the filenames he listed shows that they only have three digits instead of the usual four.  Folsombob, how did you filenames end up with only three digits?

-Kirk