Parse Telephone numbers

Hello,

If I have a US telephone number string as follows, how can I parse it in such a way where I can get the individual numbers?

Original String: 312 853-0408-0409, 4560-4563, 4567-4569

Output should be:
312-853-0408
312-853-0409
312-853-4560
312-853-4561
312-853-4562
312-853-4563
312-853-4567
312-853-4568
312-853-4569

There is no pattern to what they provide. What would be the best way to approach this type of string?

Thank you.
Regards.

@sw1336 this node should be able to split the string. Then transpose the result.

1 Like

Thanks @mlauber71. How should I handle the range?

From 4560-4563 to 4561, 4562 and 4563.

Thanks again.

1 Like

OK should have read more carfully. Operation a little bit more complicated. Will try to check it out.

1 Like

Here’s a workflow that demonstrates one way to do this transformation.

It starts with this:
image

and ends with this:
image

If you have multiple ranges to parse, then you’d encapsulate this entire workflow in a Chunk or Window Loop to treat each row.

7 Likes

Many thanks, @elsamuel! This really helps…

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.