- AuthorPosts
- October 4, 2018 at 9:16 am #23778BobBaileyParticipant
I have a phone number that looks like this:
+1(123) 456-7890 or maybe any variant of punctuation and spaces.
+1(123)456-7890, 123-456-7890, 123.456.7890
I want to end up with this:
11234567890 or 1234567890
I have tried all sorts of variants:
[0-9]+
([\d]+)
[0-9]+[0-9]+[0-9]+[0-9]+
None of which seem to work. Ideas?
Thanks… Bob
PS I would think that this would be a fairly common problem but Google only turns up language specific solutions.October 4, 2018 at 11:03 am #23779StefanParticipantFROM:
+1(123) 456-7890 or maybe any variant of punctuation and spaces.
+1(123)456-7890, 123-456-7890, 123.456.7890
–
–
TO:
1123 4567890 or maybe any variant of punctuation and spaces
11234567890 1234567890 1234567890
–
–
USE:
Find: [(),.+-]
Replace:
[x]Use RegEx
[Replace All]– – –
Depending on your work, you can also include the space to the list of sings to become removed, like: [(),. +-]
.
.
.October 4, 2018 at 12:34 pm #23780BobBaileyParticipantHi Stefan,
This is great and very useful. What I’m really looking for is a regex that returns the phone number with no punctuation. That is:
+1(123) 456-7890 >>> RegEx >>> 11234567890
Maybe this is not possible?
Thanks… BobOctober 5, 2018 at 3:49 am #23781Mr KTParticipantHi BobBailey,
Assuming you are running a fairly recent version of EmEd, try the following:Make sure your phone numbers are in a column (delimited file – e.g. tab, comma, etc.)
Select this column.
Search Menu – Replace (or Ctrl-H)
In the Find field:([0-9])
In the Replace with field:\0
Make Sure the “Use Regular Expressions” and “In the Seleciton Only” check boxes are ticked.
Click the Down arrow next to the Extract button and select “To New CSV Column”
Click the Extract button.The phone numbers should be returned in a new column to the right of your original column (without punctuation).
October 5, 2018 at 9:04 am #23787BobBaileyParticipantThanks to both of you for your suggestions. I’ve got what I need.
…Bob - AuthorPosts
- You must be logged in to reply to this topic.