Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

The following example demonstrates functions that can be used to clean up strings. These functions include the following:

Source:

In the following (space) and (tab) indicate space keys and tabs, respectively. Carriage return and newline characters are also supported by whitespace functions.

Stringssource
String01this source(space)(space)
String02(tab)(tab)this source
String03(tab)(tab)this source(space)(space)
String04this source's?
String05Why, you @#$%^&*()!
String06this söurce
String07(space)this söurce
String08à mañana

Transformation:

The following transformation steps generate new columns using each of the string cleanup functions:

D trans
RawWrangletrue
p03Value'trim_source'
Typestep
WrangleTextderive type:single value: TRIM(source) as: 'trim_source'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueTRIM(source)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'removewhitespace_source'
Typestep
WrangleTextderive type:single value: REMOVEWHITESPACE(source) as: 'removewhitespace_source'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueREMOVEWHITESPACE(source)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'removesymbols_source'
Typestep
WrangleTextderive type:single value: REMOVESYMBOLS(source) as: 'removesymbols_source'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueREMOVESYMBOLS(source)
p03NameNew column name
SearchTermNew formula

Results:

Stringssourceremovesymbols_sourceremovewhitespace_sourcetrim_source
String01this source(space)(space)  this source(space)(space)  thissourcethis source
String02(tab)(tab)this source(tab)(tab)this sourcethissourcethis source
String03(tab)(tab)this source(space)(space)(tab)(tab)this source(space)(space)thissourcethis source
String04this source's?this sourcesthissource's?this source's?
String05"Why, you @#$%^&*()!"Why you Why,you@#$%^&*()!Why, you @#$%^&*()!
String06this söurcethis söurcethissöurcethis söurce
String07(space)this söurce(space)this söurcethissöurcethis söurce
String08à mañanaà mañanaàmañanaà  mañana