reconstruct phone numbers
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I have script that extract phone numbers from an old file. The numbers are similar to these
7564329876
5663456789
5665677652
3788764564
5658762344
5655672345
3443457655
2323567899
5433454567
3243453456
they should be in this form (xxx) xxx-xxxx what I should do to get this result?
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
text-formatting
add a comment |Â
up vote
-1
down vote
favorite
I have script that extract phone numbers from an old file. The numbers are similar to these
7564329876
5663456789
5665677652
3788764564
5658762344
5655672345
3443457655
2323567899
5433454567
3243453456
they should be in this form (xxx) xxx-xxxx what I should do to get this result?
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
text-formatting
Possible duplicate of Formatting phone number column
â Jeff Schaller
5 mins ago
also unix.stackexchange.com/questions/95926/â¦
â Jeff Schaller
5 mins ago
See also: unix.stackexchange.com/q/441676/117549
â Jeff Schaller
4 mins ago
@JeffSchaller I am so sorry about that, I didn't see those! honestly I didn't even Google for it. I greatly apologizes!
â Shervan
1 min ago
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have script that extract phone numbers from an old file. The numbers are similar to these
7564329876
5663456789
5665677652
3788764564
5658762344
5655672345
3443457655
2323567899
5433454567
3243453456
they should be in this form (xxx) xxx-xxxx what I should do to get this result?
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
text-formatting
I have script that extract phone numbers from an old file. The numbers are similar to these
7564329876
5663456789
5665677652
3788764564
5658762344
5655672345
3443457655
2323567899
5433454567
3243453456
they should be in this form (xxx) xxx-xxxx what I should do to get this result?
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
text-formatting
text-formatting
edited 5 mins ago
Jeff Schaller
33.9k851113
33.9k851113
asked 8 mins ago
Shervan
34611
34611
Possible duplicate of Formatting phone number column
â Jeff Schaller
5 mins ago
also unix.stackexchange.com/questions/95926/â¦
â Jeff Schaller
5 mins ago
See also: unix.stackexchange.com/q/441676/117549
â Jeff Schaller
4 mins ago
@JeffSchaller I am so sorry about that, I didn't see those! honestly I didn't even Google for it. I greatly apologizes!
â Shervan
1 min ago
add a comment |Â
Possible duplicate of Formatting phone number column
â Jeff Schaller
5 mins ago
also unix.stackexchange.com/questions/95926/â¦
â Jeff Schaller
5 mins ago
See also: unix.stackexchange.com/q/441676/117549
â Jeff Schaller
4 mins ago
@JeffSchaller I am so sorry about that, I didn't see those! honestly I didn't even Google for it. I greatly apologizes!
â Shervan
1 min ago
Possible duplicate of Formatting phone number column
â Jeff Schaller
5 mins ago
Possible duplicate of Formatting phone number column
â Jeff Schaller
5 mins ago
also unix.stackexchange.com/questions/95926/â¦
â Jeff Schaller
5 mins ago
also unix.stackexchange.com/questions/95926/â¦
â Jeff Schaller
5 mins ago
See also: unix.stackexchange.com/q/441676/117549
â Jeff Schaller
4 mins ago
See also: unix.stackexchange.com/q/441676/117549
â Jeff Schaller
4 mins ago
@JeffSchaller I am so sorry about that, I didn't see those! honestly I didn't even Google for it. I greatly apologizes!
â Shervan
1 min ago
@JeffSchaller I am so sorry about that, I didn't see those! honestly I didn't even Google for it. I greatly apologizes!
â Shervan
1 min ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
sed
solution:
sed -r 's/.0/&(/;s/.4/&)/;s/.5/& /;s/.9/&-/' file
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
sed
solution:
sed -r 's/.0/&(/;s/.4/&)/;s/.5/& /;s/.9/&-/' file
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
add a comment |Â
up vote
0
down vote
sed
solution:
sed -r 's/.0/&(/;s/.4/&)/;s/.5/& /;s/.9/&-/' file
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
sed
solution:
sed -r 's/.0/&(/;s/.4/&)/;s/.5/& /;s/.9/&-/' file
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
sed
solution:
sed -r 's/.0/&(/;s/.4/&)/;s/.5/& /;s/.9/&-/' file
(756) 432-9876
(566) 345-6789
(566) 567-7652
(378) 876-4564
(565) 876-2344
(565) 567-2345
(344) 345-7655
(232) 356-7899
(543) 345-4567
(324) 345-3456
answered 6 mins ago
Goro
8,96064486
8,96064486
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
add a comment |Â
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
Thank you for the answer and I apologies for not looking for previous answers! My bad.
â Shervan
14 secs ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475330%2freconstruct-phone-numbers%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Possible duplicate of Formatting phone number column
â Jeff Schaller
5 mins ago
also unix.stackexchange.com/questions/95926/â¦
â Jeff Schaller
5 mins ago
See also: unix.stackexchange.com/q/441676/117549
â Jeff Schaller
4 mins ago
@JeffSchaller I am so sorry about that, I didn't see those! honestly I didn't even Google for it. I greatly apologizes!
â Shervan
1 min ago