Author Topic: Parsing information in directory names  (Read 3582 times)

Offline Gary_G

  • Newcomer
  • *
  • Posts: 37
    • View Profile
Parsing information in directory names
« on: November 14, 2015, 03:05:27 PM »
Are the string function capabilities of the current version of Photo Mechanic still limited to the equivalent of the MID$() function?

Why do I ask?

As I am migrating from another DAM system, I need to do a "mass ingestion" of my archived RAW and JPG masters from my backups. I have an archive directory in which the directory names contain variable length delimited strings containing the caption and location info for the contained files. If I could parse them, I could easily populate the IPTC caption and various location fields of the ingested files.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Parsing information in directory names
« Reply #1 on: November 15, 2015, 09:33:23 AM »
Are the string function capabilities of the current version of Photo Mechanic still limited to the equivalent of the MID$() function?

Why do I ask?

As I am migrating from another DAM system, I need to do a "mass ingestion" of my archived RAW and JPG masters from my backups. I have an archive directory in which the directory names contain variable length delimited strings containing the caption and location info for the contained files. If I could parse them, I could easily populate the IPTC caption and various location fields of the ingested files.

Variables substring extraction is documented here:

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

-Kirk

Offline Gary_G

  • Newcomer
  • *
  • Posts: 37
    • View Profile
Re: Parsing information in directory names
« Reply #2 on: November 19, 2015, 06:16:48 PM »
Yes. I read the reference. It is essentially the equivalent of a MID$() function. It does not appear to be able to parse variable length strings based on delimiters.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Parsing information in directory names
« Reply #3 on: November 19, 2015, 06:37:06 PM »
Yes. I read the reference. It is essentially the equivalent of a MID$() function. It does not appear to be able to parse variable length strings based on delimiters.

I have never used the Basic language that has a MID$ function so I don't know if it is similar to our variables substring extraction, but you are correct in that it does not have regular expression features.

-Kirk

Offline Gary_G

  • Newcomer
  • *
  • Posts: 37
    • View Profile
Re: Parsing information in directory names
« Reply #4 on: November 19, 2015, 07:52:44 PM »
Thanks, Kirk. I was hoping to embed caption and location data from the name of the directory containing the images. The string is not a fixed format, so PM will not be able to handle it. However; I think I can get around this by injecting the data using ExifTool and its PERL-like regexp capabilities.

A regexp capability might be something to consider down the road. There are public domain "library" regexp implementations available.