Skip to main content

 

Documentation & User Guides | FotoWare

Extracting metadata that can later be reapplied to assets

Learn how to extract metadata from assets in a workflow in such a way that the field identifiers are also stored in the text file. This allows you to "reverse" the process and apply metadata to assets using the text files as metadata templates in a separate channel. 

Operators

In the examples below, we will assume we'll be working with the following example metadata in Custom Field 1 (#200):

aaa_bbb-ccc/ddd/eee/fff ggg

Extracting x number of characters from the beginning of a field

Syntax: #nnn!xx

Example 1:

#200!6

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
aaa_bb

Example 2:

#200!11

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
aaa_bbb-ccc

Copy the characters from (1 based) pos a to pos b (including)

Syntax: #nnn!a~b

Example 1:

#200!5~7

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
bbb

Comment:
Characters 5, 6 and 7 copied

Example 2:

#200!9~12

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
ccc/

Comment:
Characters 9 thru 12 copied

Copy the characters from part number a in string split by character x and y

x is the character before start of the wanted part. A space here will also indicate beginning of the field when a=1.

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Syntax: #nnn!a~xy~

Example 1:

#200!1~ _~

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
aaa

Comment: Split string on space and then split the first part on '_'. 

Example 2:

#200!2~_-~

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
bbb

Comment: Split string on '_' and then split the second part on '-'. 

Example 3:

#200!3~//~

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
eee

Comment: Split string on '/' and take the third part.

Example 4:

#200!2~  ~

Source string: aaa_bbb-ccc/ddd/eee/fff ggg

Result:
ggg

Comment: Split string on space ' ' and take the second part.

Special case

Normally when you extract metadata to text files in Color Factory, you simply add a field number in the text extraction template (e.g. #120) to extract the content of that field and store it in the text file. However, the text file does not include the original field number from which it came, so you cannot reverse the process and use the text template as the basis for an operation that applies that metadata to assets again.

The trick is getting Color Factory to add the field number to the text file it creates when extracting metadata from the files. To accomplish this, you have to "trick" the parser Color Factory uses.

The below example illustrates how you can create a text extraction template that stores the assets' metadata from field 120 and prefixes it with #120 to allow another channel to reapply the metadata using text import at a later stage:

Example syntax

##EEENNN#FFF

Where EEE is an (any) empty field that does not contain any text.

NNN is the new field number you want to see in the extracted text.

FFF is the field number that you are extracting the text from in the current image.

 

Example:

##122120#120

This will put “#120This is the caption” in the text file when the caption field contains “This is the caption”.

122 was choosen as the empty field here. In practise it could be any empty field.

  • Was this article helpful?