Excerpt |
---|
Removes all characters from a string that are not letters, numbers, accented Latin characters, or whitespace. |
Info |
---|
NOTE: Non-Latin letters are also removed. |
Tip |
---|
Tip: This function also removes common punctuation, such as the following: To preserve these characters, you might replace them with an alphanumeric text string. For example, the question mark might be replaced by: Code Block |
---|
zzQUESTIONMARKzz |
After the function has been applied, you can replace these strings with the original values. |
Column reference example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:removesymbols(MyName) |
---|
|
removesymbols(MyName) |
Output: Returns the value in the MyName
column value with all non-alphanumeric characters removed.
String literal example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:removesymbols('Héllõ, Wõrlds!?!?') |
---|
|
removesymbols('Héllõ, Wõrlds!?!?') |
Output: Returns the string: Héllõ Wõrlds
.
Wildcard example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | set col:* value:removesymbols($col) |
---|
|
removesymbols($col) |
Output: Strips all non-alphanumeric or space characters from all columns in the dataset.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:removesymbols(column_string) |
---|
|
removesymbols(column_string) |
Argument | Required? | Data Type | Description |
---|
column_string | Y | string | Name of the column or string literal to be applied to the function |
column_string
Name of the column or string constant to be trimmed of symbols.
- Missing string or column values generate missing string results.
- String constants must be quoted (
'Hello, World'
). - Multiple columns and wildcards are not supported.
Required? | Data Type | Example Value |
---|
Yes | String literal or column reference | myColumn |
Example - String cleanup functions together
Include Page |
---|
| EXAMPLE - String Cleanup Functions |
---|
| EXAMPLE - String Cleanup Functions |
---|
|