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

Parsing number\word groups using REGEX

tgvxz
5 - Atom

I have been trying to separate data which has been grouped into one field. The data has the format:

ID    DATA

01    12345678Help separate this (there can be several spaces) 23456789He/She can not fix it

02     23456789He/She can not fix it        

03     98741236This error cannot be fixed  (there can be several spaces)  12345678Help separate this (there can be several spaces) 23456789He/She can not fix it

 

The common separator is that each group to separate starts with an 8-digit number (/d{8}). The first group should start with the 8-digit number and end with the last word before the next group of 8-digit numbers.

I want the data to be separated out like this:

 

ID

DATA1DATA2DATA3
0112345678Help separate this23456789He/She can not fix it 
0223456789He/She can not fix it     
0398741236This error cannot be fixed 12345678Help separate this23456789He/She can not fix it

 

 

4 REPLIES 4
Yoshiro_Fujimori
15 - Aurora

@tgvxz ,

If each field starts with 8 digit numbers preceded by at least one space,

I would replace the one space with a separator (which is not used elsewhere. I used "|".)

Then parse the data with the separator with "Text To Columns" tool.

Yoshiro_Fujimori_0-1678338171778.png

Does it work for you?

 

tgvxz
5 - Atom

@Yoshiro_Fujimori 

 

Yes, this method did work. Thank you very much.

jpowellsd
Alteryx
Alteryx

Just saw this popup, and being a regex geek, thought I'd see if I could solve it with regex :)

 

flying008
14 - Magnetar

Hi, @tgvxz 

 

FYI.

 

录制_2024_01_03_09_54_22_965.gif

Labels