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

Question

Question

Reg Expression Extract the Date from Date time

asked on September 18, 2017

Hi,

I would like to extract the Date from my OCR'ed Text

Ex.

Date Time: Apr 4 2017 5:52PM

Date Time: Apr 14 2017 5:52PM

I would like to extract the Date and convert as 

04-APRIL-2017

14-APRIL-2017

Please help.

0 0

Answer

SELECTED ANSWER
replied on September 18, 2017

Hi Ganesa,

There might be a better way but this will work.

Assuming your OCR token text is in the format "Date Time: Apr 4 2017 5:52PM".  You could do 2 steps in an 'Assign Token Value' activity.


First step is to create a new token,  DateTime_Result, by using a regexp on your OCR date time.
Date Time: (\w+ \d+ \d+)

 

The second step is to Modify the token we just created by applying formatting:
dd-MMM-yyyy


You don't have to create a new token, you could just modify your OCR token, but creating a new one keeps the original values in case you need the time portion.

Hope that helps,

Andrew
 

1 0
replied on September 19, 2017

Hi Andrew,

Thanks fro the update. Its working fine as expected.

 

Thanks & Regards

Ganesh

0 0

Replies

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

Sign in to reply to this post.