Home > database >  Extract digits in between 2 different parameters
Extract digits in between 2 different parameters

Time:06-01

I have all data being imported into one cell as:

"<blank space><email address><blank space><CustomerId><blank space><(email address)><line break for next entry>"

Example:

[email protected] 12345678 ([email protected])
[email protected] 23902490 ([email protected])

I need to extract only the customer ID's, while separating them with a comma, so I tried the following: regexreplace(A2,"([^[:digit:]])",","), however, this also extracts the numbers associated with the emails, so it returns me:

,,,,,1,,,,,,,,,,,,,,12345678,,,,,,,1,,,,,,,,,,,,,, ,,,,,224,,,,,,,,,,,,,,23902490,,,,,,,224,,,,,,,,,,,,,,

Since the email address is set by the user, I don't have control how many digits or if only digits are used in it. I can't seem to understand how to isolate the CustomerIds alone.

Please help!

CodePudding user response:

If they are separated by a space you should be able to set the space to be your delimiter and extract from there.

enter image description here

  • Related