-2

I am trying to split a string (the string length is uncertain; it could be 500 characters or 1500 characters) into multiple columns, and each column should only contain 5 characters.

For example, If column A contains the string: AAGANAB5ARAB7AAAB9AAAC--CAC--1ACMRD Then, I need Column B to Column H to be: AAGAN, AB5AR, AB7AA, AB9AA, AC--C, AC--1, ACMRD

Also, the string contains “-“, but it is NOT delimiter. It should also be counted as a part of 5 char strings.

I know RegEx is probably the function I should use, and just by putting "(.....)" in the Regular Expression, Alteryx can extract the first 5 characters. But I don't know how to ask Alteryx to automatically split the entire string (length varies each row) to columns of 5 chars.

Beans
  • 139
  • 5
  • 19

1 Answers1

1

In Alteryx, use their RegEx tool (instead of the Formula tool with one of their REGEX expressions). In the config panel of the RegEx tool, and simply enter ..... as the RegEx, and the key is to select "Split to Rows"... this will give you rows with a new field that is the result of the applied RegEx.

johnjps111
  • 1,160
  • 9
  • 24