delete empty cells in string manipulation

hi!!
i´m trying to delete the empty cells on my column “comments_body” because i used this expression: regexReplace($comment_body$, “[^a-zA-Z0-9\s]”, “”) to remove the emoji symbols. After i remove them with that expression e tried to delete the empty cells - because most of the comments that contained emojis were a full comment with just them - for that i used the string manipulation node, however i cannot discover a expression that does not produce an error when i try to apply it after wroting the regexReplace($comment_body$, “[^a-zA-Z0-9\s]”, “”) expression. What expression do you think i can use to delete the empty cells afetr using the first expression?

Hello,

Instead, you can use the tonull function to replace the empty strings with null. You can then use the missing value node to get rid of the rows with missing values in the comments column.

You might need to wrap it in a strip function to get rid of any leading or trailing white spaces.

1 Like

What about just combining the two?

toNull(regexReplace($comment_body$, "[^a-zA-Z0-9\s]", ""))

Then use a Missing Value node to remove those rows with missing values

1 Like

hi!! thank you for the help! i´m going to try this way :slight_smile:

hello!! thanks i´m also going to try this one and see which way i like best :slight_smile:

You can also do the rule based row splitter to simplify things like this into a multi step process. I typically use this split approach to “delete” rows as well (by just not joining back / concatenating the 2nd stream) since it gives me instant access to those rows if I need them later for further analysis.

1 Like

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