I have a column of data that contains numbers, text, etc.. However, I want to filter out any records with text. What is the best way to do that?
Solved! Go to Solution.
Parse it to a new column using (\w+) and then filter on the new column with !isnull(new field)
Regex_match([field],"[\u\l\s]+")
letters and space only
cheers,
mark
Drop a filter tool onto the canvas, select "custom", and enter the following expression: !REGEX_Match([Field_Name], ".*[[:alpha:]].*").
Make sure to replace the [Field_Name] placeholder with the actual field name.
This works great, however, I noticed some of the data also has text after a number. Ex 1234_DOT and 1234DOT. How would I capture these conditions?
I also want to verify the use case. From the original post, it seemed like you wanted to drop the record from your dataset that contained any letters. Can you confirm this?
However, I realized you may be trying to cleanse your data - meaning keep the records in the dataset - but remove the text and other items. For example: convert "1234_DOT" to "1234". If this is the case, I suggest using a data cleanse tool.
Best,
Jesse
yes, only looking to drop records with letters.