Alteryx Designer Desktop Discussions

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

Pulling Numbers From a String

mfranchino21
7 - Meteor

Hi, I want to pull a 23 digit number from a string. The number sometimes may be longer, but i only want the first 23 digits. There also may sometimes be more than one 23 digit numbers in one string. Here is an example:

 

-Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516

 

From here, I would want the output to be the three numbers that are 23 characters long, and only the first 23 characters. Right now Im using RefEX (\d[23]) and its outputting numbers longer than the max of 23 i want. 

 

Thanks!

6 REPLIES 6
mfranchino21
7 - Meteor

I got it to only pull 23 digits, but now i need it to pull multiple numbers, instead of just one

TimN
13 - Pulsar

Maybe like this?  You'd need to tweak if a number is less than 23 with a decimal.  

binuacs
20 - Arcturus

@mfranchino21 One way of doing this

image.png

mfranchino21
7 - Meteor

is there a way to do it without manually breaking up the text. EX, if Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 was the input, could alteryx give me three outputs to that one input? thanks for the help. 

For example, I would want

 

Input: 

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516

 

Output:

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 - 12345678910111213141516

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 - 12345678910111213141516

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 - 12345678910111213141516

 

In an essence, each 23 digit number would have its own output to that one input. 

mfranchino21
7 - Meteor

is there a way to do it without manually breaking up the text. EX, if Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 was the input, could alteryx give me three outputs to that one input? thanks for the help. 

For example, I would want

 

Input: 

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516

 

Output:

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 - 12345678910111213141516

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 - 12345678910111213141516

Test words test words 12345678910111213141516TTT, test words test words 123456789101112131415169999.99, test test test 12345678910111213141516 - 12345678910111213141516

 

In an essence, each 23 digit number would have its own output to that one input, so in this instance, 3 outputs to the one input. 

mfranchino21
7 - Meteor

thank you!!

Labels