Format conversion
You can use format conversion to configure automatic formatting for extracted index fields. This approach is far more efficient than manual formatting. Format conversion occurs after extraction and is saved to the batch.xml file.
Here are some common use cases for format conversion:
-
Assign prefixes and suffixes to document level fields
-
Swap dates to desired format
-
Swap uppercase and lowercase characters
-
Normalize common data elements
-
Replace words or values
-
Truncate strings
-
Reformat regular expressions with regex groups
Prerequisites for format conversion
You need to add the FORMAT_CONVERSION_PLUGIN to either of the following locations:
-
As the last plugin in the Extraction module.
-
As the first plugin in the Export module.
Only add the plugin to one of the modules. Ensure the Format Conversion Switch is set to ON. For more information on adding plugins, see Modules and plugins.
Configuration for format conversion
Format conversion is configured at the index field level.
- From the Batch Class Management screen, select your batch class and click Open.
- Go to .
-
Select one or more format options and configure the formation conversion rule.
Refer to the following table for a list of format options and their descriptions.
Format option
Description
Prefix
Use this option to add any value before the extracted value.
Example format conversion:
Prefix # Original extracted value 5040 Converted value #5040 Suffix
Use this option to add any value after the extracted value.
Example format conversion:
Prefix .00 Original extracted value 5040 Converted value 5040.00 Replace
Use this option to replace any character in an extracted value with another character.
-
Select Once or All to specify whether the character should be replaced only once, or throughout the extracted document.
-
Enter a character or regex in the Replace field. This is the value that is replaced after extraction.
The regex for an empty space is \s.
-
Enter a character or value in the With field. This is the value that replaces the original value after extraction.
You can create multiple replace rules by clicking the plus icon +.
Example format conversion:
Replace \s With _ Original extracted value 5040 1010 Converted value 5040_1010 Change Case
Use this option to change the case of the extracted value to either lowercase or uppercase.
If multiple format options have been configured, change case applies before prefix or suffix formatting.
Example format conversion:
Change case To Upper Original extracted value sample Converted value SAMPLE Sub String
Use this option to specify a portion of a string of text to be extracted. You need to specify the start index and end index of the part to be extracted.
Example format conversion:
Start 1 End 3 Original extracted value ABC-123 Converted value ABC To use a single character from the extracted value, specify the same value for the start and end index.
Change Currency
Use this option to convert extracted currency to a selected currency type.
You can add or remove currency codes from
.Example format conversion:
From USD To INR Original extracted value 250.00 Converted value 18853.13 Fetch Named Group
Use this option to assign a name to a capture group for future reference.
You can define how the extracted data needs to be formatted by using the regex group name.
Date Conversion
Use this option to define any date format for a date index field.
Example format conversion:
Extracted dd/MM/yyyy New MM/dd/yyyy Original extracted value 20/03/2023 Converted value 03/20/2023 You can define the date formats you want to be displayed in the format-conversion.properties file located at <Ephesoft Transact_Directory>\Application\WEB-INF\classes\META-INF\dcma-format-conversion\format-conversion.properties.
Make your changes to the formatconversion.date_formats= property.
For more information on standard date formats, refer to this Java tutorial.
Change Currency and Date Formatting do not work with other formatting options. If one of these options is selected, all other options are disabled.
-
Test format
You can test the format in the Test Extraction screen for your batch class.
- Open your batch class and go to Document Types.
- Click Upload Test Extraction File(s) or drag and drop files to the upload area.
- Click Test Extraction.
-
Use one of the following configuration methods to test format conversion:
-
Set Workflow to ON and select Format Conversion as the extracted plugin.
-
Set Workflow to OFF and set Format Values to ON.
-