Author Topic: Using code replacement for different file extensions  (Read 4017 times)

Offline emccainaz

  • Newcomer
  • *
  • Posts: 42
    • View Profile
Using code replacement for different file extensions
« on: January 07, 2013, 02:32:45 PM »
Hi,

I'm using PM 4.6.9 on Windows 7 Professional, Service Pack 1.

I'm attaching my Stationery Pad settings for code replacement. The data that I'm using to add metadata only has the jpg file names, but there are always three files I need to add metadata to: two tif files and one jpg. One of the tif files has a _m added to the file name to represent master, i.e.:
93006004_m.tif
93006004.tif
93006004.jpg

The way I have it set up, I can only get the metadata into the jpg format. I have tried using the filenamebase variable set to read only the first eight characters, but that isn't working now either. I am missing something here and I'm just not seeing it, so can someone please advise what I need to do to get all the files to receive the metadata?

Thank you,

Edward McCain
Center for Creative Photography

[attachment deleted by admin]

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Using code replacement for different file extensions
« Reply #1 on: January 07, 2013, 03:26:08 PM »
Edward,

Without having your Code Replacement text file, it would be hard to tell why things aren't matching up.  Please post your text file.

-Kirk

Offline emccainaz

  • Newcomer
  • *
  • Posts: 42
    • View Profile
Re: Using code replacement for different file extensions
« Reply #2 on: January 07, 2013, 03:56:15 PM »
Here's a sample of the code replacement file:

Thanks,

Edward

[attachment deleted by admin]

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Using code replacement for different file extensions
« Reply #3 on: January 07, 2013, 04:15:43 PM »
Edward,

Here's a sample of the code replacement file:

Remove the ".jpg" from your Codes and I think it should work fine.

Since you're using the first 8 letters of {filenamebase} you want your codes to be 8 letters long as well.

Make sense?

-Kirk

Offline emccainaz

  • Newcomer
  • *
  • Posts: 42
    • View Profile
Re: Using code replacement for different file extensions
« Reply #4 on: January 07, 2013, 04:29:07 PM »

Remove the ".jpg" from your Codes and I think it should work fine.

Since you're using the first 8 letters of {filenamebase} you want your codes to be 8 letters long as well.

Make sense?

-Kirk

I was thinking that the 8 character limit would apply to the file names as well. Does it just apply to the code replacement text?

Edward

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Using code replacement for different file extensions
« Reply #5 on: January 07, 2013, 05:11:07 PM »
Edward,


Remove the ".jpg" from your Codes and I think it should work fine.

Since you're using the first 8 letters of {filenamebase} you want your codes to be 8 letters long as well.

Make sense?

I was thinking that the 8 character limit would apply to the file names as well. Does it just apply to the code replacement text?

The Replacement text can be as long as you like.

Basically Code Replacement takes whatever is entered between the delimiters (in your case it is \ ) and looks for matches.  If nothing matches then nothing is output.  By using {filenamebase:0,8} your text between the delimiters will be the first 8 characters of the filename, not including a filename extension.  So your Codes need to not have the filename extension on them at all.  Using the {:index,count} only affects the variable and nothing else.  Then Code Replacement kicks in and tries to match a Code.

HTH,

-Kirk

Offline emccainaz

  • Newcomer
  • *
  • Posts: 42
    • View Profile
Re: Using code replacement for different file extensions
« Reply #6 on: January 07, 2013, 05:19:26 PM »

The Replacement text can be as long as you like.

Basically Code Replacement takes whatever is entered between the delimiters (in your case it is \ ) and looks for matches.  If nothing matches then nothing is output.  By using {filenamebase:0,8} your text between the delimiters will be the first 8 characters of the filename, not including a filename extension.  So your Codes need to not have the filename extension on them at all.  Using the {:index,count} only affects the variable and nothing else.  Then Code Replacement kicks in and tries to match a Code.

HTH,

-Kirk

I can delete the extension, but isn't that what filenamebase is supposed to do for me? That plus using the {:index,count} to limit the number of characters in the filenamebase seems like it should accomplish the same thing as deleting the file extension. I'm a bit confused about what's going on between the CR text file and the CR variables.

Edward

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Using code replacement for different file extensions
« Reply #7 on: January 07, 2013, 05:46:27 PM »
Edward,


The Replacement text can be as long as you like.

Basically Code Replacement takes whatever is entered between the delimiters (in your case it is \ ) and looks for matches.  If nothing matches then nothing is output.  By using {filenamebase:0,8} your text between the delimiters will be the first 8 characters of the filename, not including a filename extension.  So your Codes need to not have the filename extension on them at all.  Using the {:index,count} only affects the variable and nothing else.  Then Code Replacement kicks in and tries to match a Code.

I can delete the extension, but isn't that what filenamebase is supposed to do for me? That plus using the {:index,count} to limit the number of characters in the filenamebase seems like it should accomplish the same thing as deleting the file extension. I'm a bit confused about what's going on between the CR text file and the CR variables.

But you have to have a match in your Codes list.

Here for instance lets say you have this as your filenames:

DSC_1234.JPG
DSC_1234.NEF
DSC_1234.PSD
DSC_1234.TIF
DSC_1234_m.JPG

{filenamebase:0,8} for all of the above will evaluate to "DSC_1234"

So if you want to do a Code Replacement lookup for DSC_1234, then your Code Replacement file better have an entry whose Code is DSC_1234 and not DSC_1234.jpg or DSC_1234anythingelse.

HTH,

-Kirk