Search for the "*" character within a string using Rule Engine

I need to search for the character “*” using the Rule Engine or Column Expressions to identify every row that contains that character. My data set has segments of rows that belong together as follows:

2017-01-01 * “” “”
Equity:Opening-Balances
Assets:Bank:AFCU:Savings
2017-01-01 * “” “”
Equity:Opening-Balances
Liabilities:Bank:Chase:Marriott
2017-01-10 * “” “”
Liabilities:Bank:Chase:Marriott:CM
Liabilities:Bank:Chase:Marriott:IO
Liabilities:Bank:Chase:Marriott:MW
Liabilities:Bank:Chase:Marriott:RG
Liabilities:Bank:Chase:Marriott
2017-02-10 * “” “”
Liabilities:Bank:Chase:Marriott:BR
Liabilities:Bank:Chase:Marriott:CM
Liabilities:Bank:Chase:Marriott:IO
Liabilities:Bank:Chase:Marriott:JO
Liabilities:Bank:Chase:Marriott:MS
Liabilities:Bank:Chase:Marriott:MW
Liabilities:Bank:Chase:Marriott:RG
Liabilities:Bank:Chase:Marriott
2017-03-11 * “” “”
Liabilities:Bank:Chase:Marriott:BR
Liabilities:Bank:Chase:Marriott:CM
Liabilities:Bank:Chase:Marriott:IO
Liabilities:Bank:Chase:Marriott:JO
Liabilities:Bank:Chase:Marriott:MS
Liabilities:Bank:Chase:Marriott:MW
Liabilities:Bank:Chase:Marriott:RG
Liabilities:Bank:Chase:Marriott:DW
Liabilities:Bank:Chase:Marriott

these are text based journal entries that begin with a date field followed by the “" and then a vendor name if applicable in quotes. Identifying the "” will allow me to know when a journal entry begins and ends.

Because the “" character is a wild card, the logic does not work. I was hoping by using the syntax "**” that it would work. I have tried “*” and that is not working either.

Any help would be appreciated

hi @strewartha

One way to solve it is via Regex. In a Rule Engine you could use:

$column1$ MATCHES ".*[*].*" => "TRUE"
TRUE => "FALSE"

5 Likes

Thank you,  I made two changes to my Rule Engine.  I was using LIKE vs MATCHES and I changed "***" to  ".*[*].*" and it works perfectly.  

On another note,  do you know if it is possible in Knime to use IF statements that when TRUE  can bring  cell values from another column into a new column? or better yet, if the IF statement is TRUE, it can bring back the value of the row above within the same column?

For this task you will need

node

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