Author Topic: Use path (stripped of delimiters) as keywords?  (Read 1640 times)

Offline TomM

  • Newcomer
  • *
  • Posts: 6
    • View Profile
Use path (stripped of delimiters) as keywords?
« on: November 26, 2013, 12:19:12 PM »
I did a search and couldn't find my question previously discussed, so I hope I'm not repeating a previous discussion.  If I am, I apologize and just point me to it.

I would like to replace some or all the non-text delimiters in the path to each file in a PM contact sheet and replace them with semi-colons so that the words in the path can be automatically be used as keywords.   For example:

c:\my_pix\toms\2013_09_11\autumn-trees\

should become

c; my; pix; toms; 2013; 09; 11; autumn; trees;

Even better would be if I could exclude certain sub-strings from the parsing, for example, "c:", "my_pix", "nef", etc. should all go to nulls or just a single space character.

It seems like code replacement might be made to work, but I can't figure out how to do this.

Another possibility would be to somehow pipe Photo Mechanic's {fpth} over to something like Unix's SED or AWK that uses regular expressions and then bring the result back into PM.  (ps - I'm doing this in a Windows system, but have numerous unix text utilities available on my system)

Any suggestions would be greatly appreciated.

Thanks in advance,

Tom


Offline TomM

  • Newcomer
  • *
  • Posts: 6
    • View Profile
Re: Use path (stripped of delimiters) as keywords?
« Reply #1 on: November 26, 2013, 09:50:05 PM »
Err ... I forgot to specify that I'm using what I believe to be the latest build of PM for Win boxes:  v5-13915

This is an older computer I've dedicated to image ingest / archive / retrieval.  OS is Win Vista with a couple of SSDs, about 3 T of fast internal HD, and usually another couple of 3 T of external HDs usually attached.

T

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: Use path (stripped of delimiters) as keywords?
« Reply #2 on: November 27, 2013, 01:01:04 PM »
There is currently no way to do this in Photo Mechanic.

-Kirk

Offline TomM

  • Newcomer
  • *
  • Posts: 6
    • View Profile
Re: Use path (stripped of delimiters) as keywords?
« Reply #3 on: November 27, 2013, 09:40:34 PM »
Thank you, Kirk.  I appreciate your quick response, and I appreciate PM, which I have been using for years!

Cheers,

Tom M

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Use path (stripped of delimiters) as keywords?
« Reply #4 on: November 27, 2013, 11:25:45 PM »
Tom,

If you're not afraid of the command-line, I think you should be able to accomplish what you want using some of the tools you mentioned in combination with exiftool. Shouldn't be too hard either.

HTH,
Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl