MetaTool > Help > Extraction > Format Date
060-770 MetaTool Format – Format Date
With the MetaTool Format Date rule, you can convert dates to different formats. For example, dates can be written as “February 6, 2017”, “Feb 06, 17”, “2/6/2017”, “02-06-2017”, “6/02/2017”, etc…
By using the Format Date rule, you can make the date format consistent.
01 Format Date – Add Rule
Format Date is defined in the MetaTool Extract tab.
Press the Add button and select Format – Date to add the format rule.
02 Format Date – Setup
In our example we will make use of the CB MetaTool Keyword Doc Sep job. This job is automatically installed when you install CaptureBites MetaTool.
We will first add an Advanced OCR rule for the index field “Full Text Last Page” and find the Invoice Date from each document. Refer to the help pages of the Find Line with Mask / Words, and Find Word with Mask / Words for more details.
Finally, we will change the format of the Invoice Date from MM/DD/YYYY to MMDDYYYY. We select the index field “Invoice Date” that holds the date value we want to change.
Optionally, we enter a description.
Single-digit days and single-digit months will be converted to double digits with a leading zero, so the date is returned with a consistent length after formatting.
For example, 2/6/2017 will be converted to 02/06/2012.
Invalid dates like 32/6/2017 will not pass the formatting rule and return a blank value.
You can use the Format Date rule to find a valid date in a sequence of words.
Assume your index field contains 3 lines:
99/99/99
02/06/12
75/BA/15
If you format this multiline field with a Format Date rule, it will return 02/06/12, the only valid date in the sequence.