The ability to export metadata in various formats is a key feature for every digital asset management system. IMatch includes a wide range of export modules which allow you to export attributes, metadata and other data in a variety of formats.
Exporting Metadata and Attributes
This know-how article covers the flexible Text Export module which enables you to create text files in a variety of formats. The export module supports both UTF-8 and UTF-16 (Windows® UNICODE) encoded text, which allows you to create output which works on all platforms and operating systems. IMatch enables you to output virtually every metadata field and Attribute it maintains in the database, ready to imported into other applications and systems.
These output formats are supported:
- CSV Files (e.g. for Import into Microsoft® Excel or similar products)
- Tab-delimited formats (ideal for many databases)
- XML Files (popular cross-platform format)
- JSON Files (to process the results in JavaScript or similar)
Each format can be customized to match whatever format the importing application expects. As a result, you can export virtually anything that is stored in your IMatch database conveniently into other applications.
What To Export
You control the data to export via standard IMatch variables, which gives you complete access to all metadata and Attributes IMatch maintains for your files. Using variable formatting functions you can further format and modify the output to meet your requirements.
Each file processed by the export module produces one ‘record’ in the output. The resulting record can have any number of ‘fields’. A field has an (optional) name and a value. The name is plain text and the value is composed from one or more variables and literal text. For example:
FileName:{File.NameExt}
The name of this field is FileName and the value comes from the variable {File.NameExt}, which returns the file name and extension of the file (e.g., beach.jpg). Field name and value are separated by a colon:
To export multiple fields per record, just add additional declarations on additional lines:
FileName:{File.NameExt} DateCreated:{File.MD.createdate|format:YYYY-MM-DD hh:mm:ss} Description:{File.MD.description} Credit:{File.MD.credit}
This declaration exports 4 fields per record. To keep things tidy, this example uses shortcodes like createdate instead of the long standard variable names. See the IMatch help for details about shortcodes.
Formatting Variables
By default IMatch exports date and time information in your local date&time format (as configured in Windows). This may cause problems when the importing application expects date and time in a specific format.
To prevent any problems in this area, we use the format function together with the createdate variable to produce a date and time format in standard ISO YYYY-MM-DD HH:MM:SS format. This avoids any ambiguities.
IMatch supports dozens of variable formatting functions. Please see the Variables help topic in the IMatch help for a full list and examples.
Tip: Var Toy And Other Helpers
Not only for this case, but in general when you work with variables in IMatch, the Var Toy App can be a big help. This app allows you to enter a mix of literal text and variables and to immediately see the result.
Open an App Panel via View > Panels > App Panel (or <F9>,<1>) and select the Var Toy App in the drop-down list at the top of the App Panel:
Copy as Variable
The Metadata Panel has a useful command which allows you to copy the corresponding variable for a metadata tag into the clipboard. Right click any caption in the Metadata Panel to open the context menu:
The Copy as Variable command copies the variable for the clicked metadata tag into the Windows Clipboard. From there you can insert it into the VarToy App or into whatever feature you want to use it with.
Running the Text Export
Select the files you want to include in the export and drop them on the Text Export module in the Import & Export Panel. You can also drop one or more folders, categories, collections or time-line nodes.
If the panel is not visible, open it via View > Panels > Import & Export or <F9>,<X>.
After you have dropped the objects, the Text Exporter opens a dialog box where you can configure the format and options for the export:
The options in this dialog are mostly self-explanatory. Press <F1> to open the corresponding topic in the IMatch help, which explains each option in detail. The help also contains examples and suggested output formats for a variety or common applications.
We create a standard CSV (comma-separated values) file in this case. Fields are separated with a comma (,) and each row (aka ‘record’) is delimited with a carriage return / line feed pair. This is the format expected by most Windows applications and Office suites.
At the bottom of the dialog you see the field definitions we have defined earlier. We just coped them from the VarToy App into the input field in the Text Export module. You can of course also enter and edit them in this dialog directly.
The Result
After running the export for 3 sample files, we can open the resulting file in Windows Notepad for a quick check:
Or we open it directly in Microsoft® Excel (or Open/Libre Office):
CSV files like this using , ; or <tabulator> as field separators can be imported by most Office applications, statistic software, database systems etc.
XML Output
If you have more sophisticated applications, they often support XML or JSON as an import format. If we run the same export again, but this time switch the output format to XML, we get a result that can be easily re-formatted and imported by a wide range of applications across all platforms:
Note that the only change was switching the output format to XML. Our field definitions are the same as before. The Text Export module automatically used the field names as node names for the XML file and converted the values into proper XML data records.
Summary
The Text Export module in the digital asset management system IMatch is a flexible tool for exporting metadata and Attributes into other applications. It can produce plain text and CSV files, but also more advanced formats like XML and JSON. Using a mix of IMatch variables and text you can control the data you export, and the format in which the data is exported.
Whether you want to reuse data stored in your IMatch database in Excel or a Word Processor or you want to copy data into other database systems, the Text Export module is a great and easy way to handle this.
See also the related know-how article Using the Copy Data App With Your Office Application for another way to quickly transfer data from IMatch to other applications.