I have a text file containing US phone numbers. I am writing a shell script to convert them to E.164 format.
I think I just need to remove every character except numbers, and then add "+1" on the front. So if the phone number looks like (800) 123-4567
or 1-800-123-4567
e.g., it should be formatted as +18001234567
.
How do I do this, with just shell scripting?
Similar Questions
- What is the best way for converting phone numbers into international format (E.164) using Java? - same question but in Java, and needs to work for all international phone numbers (not just US)