Cleaning Text with Regular Expressions
  • 23 Dec 2022
  • 1 Minute to read
  • Dark
    Light

Cleaning Text with Regular Expressions

  • Dark
    Light

Article summary

These exercises focus on manipulating text data through regular expressions.


Exercises

  1. Use the RegEx tester at regex101.com to find the following regular expressions:
    1. All whitespace at the beginning and end.
    2. Any periods.
    3. Any capital letters after a space.

  1. Clean the cleanse.csv file by doing the following:
    1. Remove all whitespace at the ends
    2. Replace any periods with underscores
    3. Remove any whitespace before capital letters

  1. Create 3 new columns that denote if that condition is satified for a given record.

Hints

  1. Read through Cleanse.

  1. Read through Derive and Select.

Was this article helpful?