INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Parsing multiple Keywords from filenames  (Read 1207 times)

RandyP

  • Regular Member
  • World Citizen
  • ***
  • Posts: 218
  • Notre Dame
Parsing multiple Keywords from filenames
« on: November 20, 2009, 01:40:05 pm »

"Fill Properties From Filename" is very useful, but I have run into an unknown. I have images whose filenames contain more than one keyword, such as:

  Jupiter-Io-Transit.tif
  Jupiter-Io-Volcano.tif
  Jupiter-Callisto-Transit.tif

When using "Fill Properties From Filename", "Directories" is turned off. I'm only using "Filename", in this manner:

  [Album]-[Keywords]-[Keywords]

Since the Keywords field is semicolon-delimited, I expected this to parse Keywords as "Io;Transit", "Io;Volcano", "Callisto;Transit". However, only the last appearance of [Keywords] is kept. Any prior occurrences are discarded by the last.

I've tried adding a semicolon and plus sign here and there, but now I need to ask if it's even possible. Thanks!
Logged

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4565
Re: Parsing multiple Keywords from filenames
« Reply #1 on: November 20, 2009, 02:52:25 pm »

that is an interesting problem. could not think of a solution either, expressions also dont work.

you could use an expression though to fill your keywords from the filename by using an expression in the keywords.
if the files all have the same form as the ones you posted you could try to put this in keywords in the tags
Code: [Select]
=listitem([Filename (name)],1,-);removeright(listitem([Filename (name)],2,-),4)the first listitem gives you the 2nd value from the items seperated by - the second listitem gives the 3rd item and takes of the .tif.
when you already have some values in keywords, just put [keywords]; after the = sign. just try one or two to see if it gives what you want.

 :)
gab

edit; this is actually a little bit better:
Code: [Select]
=listitem(removeright([Filename (name)],4),1,-);listitem(removeright([Filename (name)],4),2,-)
Logged

RandyP

  • Regular Member
  • World Citizen
  • ***
  • Posts: 218
  • Notre Dame
Re: Parsing multiple Keywords from filenames
« Reply #2 on: November 20, 2009, 03:35:52 pm »

Quote
you could use an expression though to fill your keywords from the filename by using an expression in the keywords.
gappie - nice thinking, especially the edited version. Thank you!

Quote
if the files all have the same form as the ones you posted you could try to put this in keywords in the tags
That's a problem. These are files built up over 15+ years without this kind of parsing in mind. Good old Explorer Search would do the job before MC/MJ. That means there are an arbitrary number of fields, based on whatever seemed interesting in the image at the time.

My plan was to sort them by filename, select a group with the same number of keywords, then process the command for that group. Repeat for next number of keywords, and so on.

It seems like a useful feature for any semicolon-delimited field. Perhaps a syntax such as:

  [Album]-[Keywords]-[Keywords+]
  [Movie]-[Actors]-[Actors+]                        ...or...

  [Album]-[Keywords]-[;Keywords]
  [Movie]-[Actors]-[;Actors]

Logged
Pages: [1]   Go Up