You are viewing limited content. For full access, please sign in.

Question

Question

Quick Fields, date issues with OCR

asked on August 8, 2016 Show version history

Hello,

I have some troubles with a date field. The date format is : dd/MM/yyyy. In a document I have this date : 17/02/1986 but the OCR activity give me this result : 1710211986 so I need to convert the second and the third "1" into "/".

I've tried to do it with substitue activity but it seems that it doesn't handle regular expression.

Any idea ?

Regards.

0 0

Answer

SELECTED ANSWER
replied on August 9, 2016

There may be better ways but one approach I've used is to break the date down into a day, month and year and then recombine them. Within the pattern match activity, create 3 tokens for day, month and year with the following regex:

Day - (\d\d)[1/]
Month - \d\d[1/](\d\d)
Year - \d\d[1/]\d\d[1/](\d\d\d\d)

(I know you can use "\d{2}" or "\d{4}" etc instead but I think it can be hard to read!)

In each case it extracts the relevant  portion of the date regardless of whether it reads a "1" or "/". You could then recombine the tokens into the field or another token.

1 0

Replies

replied on August 9, 2016

Thank you Nigel.

I was looking for an activity that could do that but your trick works great !

Regards.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.