String Manipulation - Replace using wildcard in the search

Hi,

I have a quick question on the String Manipulation Node. I want to do a replace with a wildcard. I want to find “Final POG” or “Final POG (3/5/2020)” and replace both with “Final POG/IRC”. I used the asterisk as the wildcard but does not find and replace. Also tried the question mark. Is this possible using the String Manipulation node?

Any help is greatly appreciated.

Thanks,

K

Hey @KevinD1,

Please see this Replace Strings.knwf (7.6 KB) workflow. It shows how to use the regexReplace in the String Manipulation Node, and with wildcards in the String Replacer Node.

Let me know if that helps.

Regards,
Wali

2 Likes

Hello @KevinD1,

LIKE operator in Rule Engine node accepts wildcards. So if you are replacing the content of entire cell (which from example seems you are) then this node is also an option for you and it’s quite simple. Something like this:
$Data$ LIKE "*Final POG*" => "Final POG/IRC"

I have added asterisk at the beginning as well in case something else can come up before it.

Br,
Ivan

Guys,

Thank you very much for the help. I got the String Manipulation to work but not the Rule Engine. One thing I forgot to mention is that I need to do this for several strings not just the one example I sent. I thought I would be able to create different lines within the String manipulation node but that does not work. Is there a way without doing a node for each string I need to replace?

Take a look at String Manipulation Multi-Column and Column Expression. Those could potentially help reduce the amount of nodes you need.

Regards,
Wali

Hello @KevinD1,

hmmm… What was problem with Rule Engine? In case you have lot of rules there is Rule Engine (Dictionary) node. Sharing some dummy data and desired output is usually a good approach. Others understand what you need and you get better ideas/solutions :wink:

Br,
Ivan

A post was split to a new topic: Read multiple Excel files in a loop

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.