Skip to main content
Documentation & User Guides | Fotoware

Turning filenames into usable, searchable metadata

This scenario explains how you can populate metadata fields with file name prefixes that are used in your organization, and suggests how you can turn those short codes into meaningful, searchable metadata.

Usage scenario

In many businesses, there are established conventions for naming files. These can be prefixes that indicate the department at which they originate, the project they are a part of, and so on. In Color Factory you have the possibility to turn these filenames into meaningful metadata. Often this will be a two-step process: First, you map the filename prefixes to individual metadata fields, then you process the metadata fields by replacing the abbreviations with meaningful content.

Consequently, it can turn a file called acc-rep-07-22-Monthly Report.xls into a file from the Accounting department, and file it as a Report for July 2022.

In the following, we'll see exactly how this can be set up using the metadata features in Color Factory.

How to do it

First, you'll need to create a channel in Color Factory and enable two features in that channel: Input Formats to control how non-image files are treated (in case this should be used for routing of other file types) and Metadata, where we will set up the mapping of file name prefixes to a metadata field.

1. Configure Color Factory to allow processing of non image files

Expand the Input File Formats feature and go to the Other Formats tab. Make sure that handling of Unknown files is set to Copy the original file to the OUTPUT folder, using all features. This will ensure that all routing and other non-image-editing features will be applied (see the example below). 

CF Processing of non image files.png

2. Set up mapping of prefixes to metadata fields

Expand the channel's Metadata feature and go to the File name to Metadata tab.

Here you need to enable Split file name to multiple strings and copy to Text fields (this enables the feature) and choose how many levels of prefixes your files have (the X Parts drop-down box)

Depending on how your file names are constructed you can now either define separators for each level (dash, underscore or whichever character(s) you use to separate prefixes) and the text field to which you want to map the prefix. If your filenames don't use separators but rather have individual-length prefixes, you can choose Use fixed size parts instead of separator character. Then you can enter a number in the Part field to indicate the length of each prefix.

File name to metadata mapping.PNG

In the example above we've configured Color Factory to split the prefixes in four parts that can be of individual length. The prefixes are split by a dash.

Assuming a file that arrives in the queue is named acc-rep-07-14-Monthly Report.xls, the prefixes acc, rep, 07, and 14 will be mapped to the Custom Fields specified above, while test rest of the filename is ignored.


Making the prefixes stored in metadata more meaningful

 Next, you'll want to make the prefixes stored in the metadata more meaningful. You can of course do that with a macro that replaces a predefined set of prefixes with a more meaningful string.

In short, you can set up another channel that uses the output of the previous channel as its input, and executes a metadata macro that replaces the contents of these fields. That's all well when you only have a limited set of abbreviations to deal with, but assuming you have lots of categories to contend with, you may for example want to store this somewhere central, such as in a database table. You can then configure this second channel in Color Factory to look up short codes in the database and replace them with meaningful data.

That ODBC scenario is covered in another topic.