KeyView 23.4

# Metadata Examples

If you want to process both standardized and non-standardized metadata fields, you can loop through a KVMetadataList without checking the `eKey` member – both standardized and non-standardized metadata can be handled in the same way.

However, standardization allows you to handle particular metadata fields differently. Below are some illustrative examples of ways you might use standardized fields to act on documents.

    // Ignore non-standardized fields
    if(element->eKey == KVMetadataKey_Other)
    {
        continue;
    }

    // Ignore small images
    if(element->eKey == KVMetadataKey_ImageWidth)
    {
        int64_t width = *(int64_t*)element->pValue;
        if(width < 200)
        {
            break;
        }
    }

    // Search for documents created by a certain company
    if(element->eKey == KVMetadataKey_Company)
    {
        KV_String company = *(KV_String*)element->pValue;
        if(strncmp("OpenText", company.pcString, company.cbSize) == 0)
        {
            return pathToInputFile;
        }
    }

    // Find all documents created since the beginning of 2022
    if(element->eKey == KVMetadataKey_Created)
    {
        int64_t created = *(int64_t*)element->pValue;
        //2022-01-01 00:00:00 UTC in Windows File Time
        if(created > 132854688000000000)
        {
            return pathToInputFile;
        }
    }

Copyright 1997-2023 Open Text
Version 23.4 | Last updated September 2023

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL KeyView 23.4

Topic Title: Metadata Examples