# Each line of the metadata_mapping_rules tab-separated value file must consist of 5 entries # 1. Source metadata name to use # This must start with either 's/...' or 'm/...' # 's' means the line is a substitution rule, which is always aplied to generate the desintation metadata name+value # 'm' means the line must match the regular expression before the rule is applied to generate the desintation metadata name+value # 2. Source Regex it needs to match # 3. Destination Regex substitution # 4. Regex modifiers (e.g. 'i' of case-insensitive, 'g' for global) # 5. Destination metadata name to set with the modified value Source, s/\.\w+$/, // , '' , _transientSourceTitle1 # removes filename extension from end _transientSourceTitle1, s/([A-Z][a-z]+)(?=[A-Z])/, /$1 /, 'g', _transientSourceTitle2 # break up CamelCase _transientSourceTitle2, s/(_|-)+/, / /, 'g', ex.SourceTitle # reduce sequences of underscores and/or hyphens to a single space per sequence