Question

How to Extract Date and Time from String ?

  • 8 January 2022
  • 2 replies
  • 531 views

 

For example string is : "Date is 05/01/2022 on 01.30 PM "

from above string , only extract date and time removing other words.

How to use Regular expression ?

or any other way to extract only date and time from string?

 

 


2 replies

Hi @Rajkumar Jagdale​ 

 

You can use String Package. Use 'Substring" , " Extarct".

or

please refer below similar qustion

 

https://apeople.automationanywhere.com/s/question/0D52t00000s7dfsCAA/string-to-date-conversion-in-a2019-hello-i-am-extracting-date-from-xml-document-and-want-to-convert-it-to-date-so-that-i-can-compare-it-can-somebody-guide-me-how-to-convert-string-to-date-in-a2019/p>

 

Userlevel 4
Badge +7

Hi @Rajkumar Jagdale​ ,

 

You can download the Regex Tools Package from the bot store and use the Regex Tools: Extract a Regex Match Action after passing in the pattern:

\d+?\/\d+?\/\d+

 

image 

Or you can use the String: Replace Action with the following pattern:

[A-z\s]+|\d+\.\d+

 

image 

Kind Regards,

Ashwin A.K

 

Reply