How to identify Date found in particular row in excel

Hi Team,

I want to identify the date found in particular row else Throw exception and another row if found only text in that row throw exception

This is always same row data only ,so this is static

Input:
image

row(0) - Found only string so i want throw exception
row(1) - Date found so skip it, If expect date whatever data found Throw exception
If row(0) found any number or alpha numeric skip it.

Please anyone help me for this,

Regards,
Raja G

Hello @Raja.G

You can use the expression "\d{4}-\d{2}-\d{2}" in the “Is Text Matching” activity to check if a row’s value matches the pattern, which will return a boolean value of True or False.

1 Like

Hello Raja,

Can you be a little more clear on what you want to do?

Without fully understanding your request I believe the solution will be around LINQ expressions and/or Regex.

@O_Almeida ,

First row – If found only text i want to throw exception , If expect text whatever data found in that row skip it

Second row-- If found date skip it, Except date any data found i want throw exception.

Regards,
Raja G

Hi @Raja.G

Can you try below

1.Read Range activity
2.For each row in datatable activity
→ If actvity System.Text.RegularExpressions.Regex.IsMatch(CurrentRow(0).ToString, "^[a-zA-Z]+$")
Then Throw
Else Your process
→ If activity System.Text.RegularExpressions.Regex.IsMatch(CurrentRow(0).ToString, "\d+\-\d+\-\d+")
Then Your process
Else Throw

Regards,