Create a column for classifying and tagging the reference number based on 3 criteria's

Hi Experts…
Create a column for classifying and tagging the reference number based on 3 criteria’s

  1. Number i.e. Reference no containing numbers only
  2. Alphanumeric i.e. reference no.containing numbers and alphabets
  3. Special character i.e. reference no.containing numbers, alphabets & special character

Anyone please suggest the answers

This is a job for regex. I would use either the Column Expressions node and Regex Match to look for matches, or Rule node with the MATCHES function.

Can you upload a KNIME workflow with some dummy data?

1 Like

Also, for #3

Can you elaborate on “special character”? Is that a single predefined character, or a list? (Which one / ones?) Do you know what position it would fall in on the string? I am assuming that it is not a general match to any “special characters”, as that would likely match all entries.

1 Like

Hi
Thanks for the reply iam sharing one file as a sample
sample_data.xlsx (3.4 KB)
i want to create a new column and if compltely numeric value “1” if contain any alphabets “2” any other charecter “3”

1 Like

Regex for condition 1 - “[\d]+$”

Regex for condition 2 - “[\da-zA-Z]+$”

Condition 3 should just catch all remaining that don’t match 1 or 2.

I will upload a workflow solution when I get into the office later this morning if someone hasn’t already.

@manojmadhu

3 criteria classify.knwf (16.6 KB)

Here it is with both the Rule and Column Expressions Nodes.

1 Like

Great …
Thank you boss …

1 Like

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