How to update Status as "Bad" for Addresses which are not starting with Number

Input :


I want output like this :

If “Address” starts with only Number, then Status should come as “Good”… if it is not starting with only Number (and if it contains “-” in between) then the Status should come as “Bad”…
It would be really grateful if anyone suggests me some idea on this…I tried using IsMatch condition but not getting correct output…Please recommend any idea.

1 Like

@Kavyasri… please check this …

Use the below regex. Count = 1 then good …if not then right bad …

1 Like

@prasath17 Thanks for the idea, You mean I need to use like this?

You can right as shown below…

Regex.Matches(Row(“ColumnName”),“\d±”).Count >= 1) then Good…Else Bad…
image
In the then activity use write cell to write the respective row…use index/counter to increment …

Your solution looks good, but I am getting some error when I use that… Previously I used the below process but didnt get exact output…Main.xaml (9.5 KB)

Can you please send me any sample workflow?

1 Like

Hello @Kavyasri

  • Use Read Range, and get output like outDt
  • For each row, Pass outDt
  • Use IF Activity like row(“yourColumnName”).ToString.Contains(“-”)

Then: Assign row(“Staus”) = “Bad”
Else: “Address is good”

out side For each row use write range and pass the same path and input as outDt

Cheers
@Kavyasri

@Kavyasri

Use IsMatch activity and pass as below

So the output is a boolean value

Hope this helps you

Thanks

Hi @Kavyasri,

I hope this helps, Fourm.xaml (8.9 KB)

Cheers
@Kavyasri

@Kavyasri
Regex Ismatch with following pattern:
grafik

^\d+\b

^ for begin
\d+ for 1 or more digits
\b word end
\ (Space) to exclude the -

2 Likes

Hi @Pradeep_Shiv, thanks for replying… My query is : I want Address as “Bad” if it is not having only Number at starting… For ex: if Address is "1234 Ab colony " then Status is “Good”, if “Address” is “Charles 2nd Street” then “Status” is “Bad”… Likewise if Address is “234-866 Bluecross Area” then also it is “Bad” because ‘-’ is there in between number…You said solution only for ‘-’, but my doubt is different.

@Kavyasri

Can you share the sample excel file

Thanks

1 Like

@Srini84, I tried this…not getting exact output

@ppr - I am trying to improvise the solution…Saying if there is a space come after number and then followed by - , then the address is still bad right?

So i have added as shown below…But its selecting the 4th one also…how do I restrict to begin of the string…i tried ^ it is not working…Please advise.
image

1 Like

@Srini84, Excel file
trial1.xlsx (8.7 KB)
My process
Main.xaml (9.5 KB)

Hello @Kavyasri,

Use the pattern mentioned by @ppr,

Cheers

1 Like

Hi @Kavyasri,

Fixed it trial1.xlsx (9.1 KB) TestExcel.xaml (9.5 KB)

Cheers

2 Likes

Just change the Cell value there,

1 Like

@ppr Now I tried this
Main.xaml (9.5 KB)
But I am not getting output exactly…Getting like this


But I want Status as “Bad” for "928-3313 Vel Av.Idaho Falls " and “711-2880 Nulla St.Mississippi 96522” …Because ‘-’ is there in between.

1 Like

Hello @Kavyasri,

Please try this code and let me knowTestExcel.xaml (9.5 KB)

Cheers

@Kavyasri

as mentioned above. Have a look below:
grafik

it is not matching so status is bad

1 Like