Find given number is date format or plain number

Hi Friends,

I have an excel like below.

BU
2226
2226
11/19/2018 00:00:00
11/20/2018 00:00:00
11/22/2018 00:00:00
11/19/2018 00:00:00
11/21/2018 00:00:00
2391
2391
11/19/2018 00:00:00
11/20/2018 00:00:00
11/22/2018 00:00:00
11/19/2018 00:00:00
11/21/2018 00:00:00

i need to display ‘it is a number’ when bot encounters 2226 or 2392.
and display ‘it is a date’ when bot encounters dates.

where BU is a column header.

please help

  1. Read Excel File
  2. Convert to OutputDataTable (to convert all the data to strings)
  3. Add a condition, if string contains either “/” or “:”, consider it as a date else number

Regards,
Karthik Byggari

Hello,

you can use either string manipulation or use Data Type of your element to achieve your goal. I have used Data Type please check it.
Data Type.xaml (8.7 KB)
Type.xlsx (9.3 KB)

You can use isMatch activity with regex.

  • For numbers use the pattern “\d+”
  • For dates, use the pattern “[\d//: ]+”

You can check the regex pattern using regexr.com.