Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Split a string with an uncertain length into 5 characters per column

EmmaG
5 - Atom

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 these are NOT delimiters. They should also be counted as a part of 5 char strings.

I am not sure how to do it, tried to search online. And I found RegEx is probably the function I should use, but not sure how to write the formula in this case.

4 REPLIES 4
Luke_C
17 - Castor

You could try something like this to parse it out into rows, from there you can use a cross tab tool to get the columns. 

 

Luke_C_0-1615838480881.png

 

EmmaG
5 - Atom

Unfortunately, I can't do in this way. I have a lot rows already (like more than 10,000 rows of data), and I don't think this way would work when you have rows after rows. 

Qiu
21 - Polaris
21 - Polaris

@EmmaG 

I would do the same with @EmmaG and dont worry about the data size even its more than 10k. Alteryx can sure handle it.

Let me finish the sentence here.

A4.PNG

EmmaG
5 - Atom

Thank you! 

Labels