Removing caret sign and adding parentheses to pager numbers
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have strings like these
NE234GJKLKU,*9^789098
NE345HJsdfe,*1^534656
YBKJNJKHBKK,*1^987654
UTGHNKOIUYO,*1^123421
ERTYUIJHGLK,*1^456666
that I wish to be:
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Any suggestions?
text-processing
New contributor
add a comment |Â
up vote
2
down vote
favorite
I have strings like these
NE234GJKLKU,*9^789098
NE345HJsdfe,*1^534656
YBKJNJKHBKK,*1^987654
UTGHNKOIUYO,*1^123421
ERTYUIJHGLK,*1^456666
that I wish to be:
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Any suggestions?
text-processing
New contributor
Sorry, should be correct now!
â Cumar
36 mins ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have strings like these
NE234GJKLKU,*9^789098
NE345HJsdfe,*1^534656
YBKJNJKHBKK,*1^987654
UTGHNKOIUYO,*1^123421
ERTYUIJHGLK,*1^456666
that I wish to be:
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Any suggestions?
text-processing
New contributor
I have strings like these
NE234GJKLKU,*9^789098
NE345HJsdfe,*1^534656
YBKJNJKHBKK,*1^987654
UTGHNKOIUYO,*1^123421
ERTYUIJHGLK,*1^456666
that I wish to be:
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Any suggestions?
text-processing
text-processing
New contributor
New contributor
edited 29 mins ago
Arkadiusz Drabczyk
7,40521633
7,40521633
New contributor
asked 43 mins ago
Cumar
133
133
New contributor
New contributor
Sorry, should be correct now!
â Cumar
36 mins ago
add a comment |Â
Sorry, should be correct now!
â Cumar
36 mins ago
Sorry, should be correct now!
â Cumar
36 mins ago
Sorry, should be correct now!
â Cumar
36 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
try sed
sed -r -e 's/^//g;s/^.13/&(/;s/^.17/&)-/' file
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
thank you for helping me
â Cumar
35 mins ago
add a comment |Â
up vote
0
down vote
Another sed
solution:
$ sed 's,*,*(,g' FILE | sed -E 's,([0-9])^([b0-9])([0-9]),123)-,g'
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Single line:
$ sed -E 's,*,*(,g;s,([0-9])^([b0-9])([0-9]),123)-,g' FILE
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
try sed
sed -r -e 's/^//g;s/^.13/&(/;s/^.17/&)-/' file
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
thank you for helping me
â Cumar
35 mins ago
add a comment |Â
up vote
3
down vote
accepted
try sed
sed -r -e 's/^//g;s/^.13/&(/;s/^.17/&)-/' file
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
thank you for helping me
â Cumar
35 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
try sed
sed -r -e 's/^//g;s/^.13/&(/;s/^.17/&)-/' file
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
try sed
sed -r -e 's/^//g;s/^.13/&(/;s/^.17/&)-/' file
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
answered 42 mins ago
Goro
8,25854282
8,25854282
thank you for helping me
â Cumar
35 mins ago
add a comment |Â
thank you for helping me
â Cumar
35 mins ago
thank you for helping me
â Cumar
35 mins ago
thank you for helping me
â Cumar
35 mins ago
add a comment |Â
up vote
0
down vote
Another sed
solution:
$ sed 's,*,*(,g' FILE | sed -E 's,([0-9])^([b0-9])([0-9]),123)-,g'
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Single line:
$ sed -E 's,*,*(,g;s,([0-9])^([b0-9])([0-9]),123)-,g' FILE
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
add a comment |Â
up vote
0
down vote
Another sed
solution:
$ sed 's,*,*(,g' FILE | sed -E 's,([0-9])^([b0-9])([0-9]),123)-,g'
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Single line:
$ sed -E 's,*,*(,g;s,([0-9])^([b0-9])([0-9]),123)-,g' FILE
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Another sed
solution:
$ sed 's,*,*(,g' FILE | sed -E 's,([0-9])^([b0-9])([0-9]),123)-,g'
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Single line:
$ sed -E 's,*,*(,g;s,([0-9])^([b0-9])([0-9]),123)-,g' FILE
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Another sed
solution:
$ sed 's,*,*(,g' FILE | sed -E 's,([0-9])^([b0-9])([0-9]),123)-,g'
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
Single line:
$ sed -E 's,*,*(,g;s,([0-9])^([b0-9])([0-9]),123)-,g' FILE
NE234GJKLKU,*(978)-9098
NE345HJsdfe,*(153)-4656
YBKJNJKHBKK,*(198)-7654
UTGHNKOIUYO,*(112)-3421
ERTYUIJHGLK,*(145)-6666
answered 30 mins ago
Arkadiusz Drabczyk
7,40521633
7,40521633
add a comment |Â
add a comment |Â
Cumar is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Cumar is a new contributor. Be nice, and check out our Code of Conduct.
Cumar is a new contributor. Be nice, and check out our Code of Conduct.
Cumar is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
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%2f474640%2fremoving-caret-sign-and-adding-parentheses-to-pager-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
Sorry, should be correct now!
â Cumar
36 mins ago