Modify only rows in Excel that contains "String"

Hello,

I am building my first robot that will check if all received orders are written into Order Table.
We are receiving orders from few different companies so file name is different for each other but all have one in common: each file name contains order number. The goal is to get that order number, write into excel then check that such number exists in Order table.

sample order number:
4287289_439048349032323_BATU
P11010_EFZ222_120
3590345834_43434_3434_P

I bolded order number.
my idea to get that number:
If ExcelRow contains “BATU” then do action
Else
If ExcelRow starts with P11010 then do action

The problem is that Bot do action from first if so I got wrong result for second Order type
How can I do something like that:
Modify text in Excel row that contains “BATU”
Modify text in Excel row that starts with “P11010”
?

Thank you in advance for your help

@Janek_Jan

Welcome to the forums

You can use TryCatch for this, so if there is any exception you can write the steps in the exception block

Hope this may help you

Thanks

1 Like

when we can rely on some pattern maybe Regex will help
grafik
[\d\_]+(?=\d{5}_BATU)|(?<=P11010[\w\_]{11})\d+

[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum

1 Like

I do not have TryCatch in my StudioX

looks complicated but I will try,thanks. It might be handy to know Regex