Removing Rows with Specific Criteria

Greetings!

My target column is the one named ‘new column’ as shown above. I am trying to remove rows fulfilling either one of these criteria:

  1. if it’s a non-alphanumeric character, OR
  2. if it’s a lowercase alphabet

Thank you!

You could use regex / case functions to change the targets in a new column, and then filter out the rows where the values are different.

I tried to use the Row Filter’s regex by looking up for the script online. Didn’t work out. It had the ^ symbol, but now when I discard the ^, the script already worked. I then just have to configure the node properly. Thanks for the idea, but I eventually ended up to only need one node which is the row filter itself, with the right configuration and the right script.

1 Like

hi @badger101 this regex should work, assuming the column always contains exactly 1 char


If, as I presume, “New column” contains the first letter of “Set”, you can filter directly on that column

4 Likes

@duristef That’s the one I mentioned that worked for me (the first photo you showed). You were a few minutes late though :slight_smile:

Anyway, can you help clarify the script for the second photo you showed?

One thing I noticed was that the ^ you used was outside of the brackets. The one I used which didn’t work out was inside, as in [^]. Maybe that was why it didn’t work out for me.

@badger101

“The quick and the dead - in this town, you’re either one or the other”

Sorry, I didn’t notice your post. The second regex means: match a string starting with an alpha char followed by zero or more chars.
“^” and “$” mean “start” and “end” of string respectively. But inside square brackets “^” is a negation: “[^A-Z0-9]” means “all characters other than A-Z and 0-9”

2 Likes

@duristef Thanks! Lastly, for the dot . symbol, what does it represent and why is it outside of the brackets?

Hi @badger101 , I’m not an expert with regex, but if I’m not mistaken, the dot means single character.

Hopefully @duristef can confirm :wink:

2 Likes

@badger101
Yes, @bruno29a is right. If you want to match a dot you must escape it in the regex by preceding it with a backslash: "\." (or "\\.", in most nodes)

3 Likes

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