How to remove unwanted string in the Excel row using a wildcard

Hi there!

I am working on a simple automation wherein I am extracting data from web and writing it to an excel sheet. There are two columns, one is NAME and the other is URL.

In the URL column, the data contains something like this:
https://www.helloworld.com/123456/?somestringthatIwantedremoved

I want to remove any string starting from the question mark so I’d be left with https://www.helloworld.com/123456/

The sequence looks like below.
Open Browser > Data Scraping > Excel Application Scope > ??? Cleanup data table (remove unwanted string)

How do I proceed to do that?

Thanks in advance.

save URL into a variable(say Url) and use the command “Url.substring(0,Url.indexof(”?"))" to remove any string starting from ?

1 Like

@kimuhm
we can do it defensive with methods from the URI Class
grafik

And can also handle if the query part is missing
grafik

Substring failed in that case

Hi @kimuhm
You can try this way as specified in sample workflow
it will remove the required part using invoke code
process1.zip (3.4 MB)

Mark it as solution if it helps you
Regards,
Nived N
Happy Automation