add new line after fourth comma
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have these long IDs which are consisted of four sections
AKJHGFGUIKL,OIUYT,KJHBTYUI,98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL,6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH,34567898766
I want to put the numbers in new line and remove the third comma.
AKJHGFGUIKL,OIUYT,KJHBTYUI
98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL
6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
how can I do this?
text-processing csv
New contributor
add a comment |Â
up vote
2
down vote
favorite
I have these long IDs which are consisted of four sections
AKJHGFGUIKL,OIUYT,KJHBTYUI,98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL,6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH,34567898766
I want to put the numbers in new line and remove the third comma.
AKJHGFGUIKL,OIUYT,KJHBTYUI
98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL
6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
how can I do this?
text-processing csv
New contributor
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have these long IDs which are consisted of four sections
AKJHGFGUIKL,OIUYT,KJHBTYUI,98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL,6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH,34567898766
I want to put the numbers in new line and remove the third comma.
AKJHGFGUIKL,OIUYT,KJHBTYUI
98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL
6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
how can I do this?
text-processing csv
New contributor
I have these long IDs which are consisted of four sections
AKJHGFGUIKL,OIUYT,KJHBTYUI,98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL,6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH,34567898766
I want to put the numbers in new line and remove the third comma.
AKJHGFGUIKL,OIUYT,KJHBTYUI
98765434567
RTYUIKHGFGH,TYUJI,TGHYJKJKLJKL
6789876
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
how can I do this?
text-processing csv
text-processing csv
New contributor
New contributor
edited 4 mins ago
Jeff Schaller
33.8k851113
33.8k851113
New contributor
asked 17 mins ago
Simon Q
111
111
New contributor
New contributor
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
3
down vote
sed "s/,/n/3" file
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
...sed "s/,/n/3; G"
to add the double spacing
â steeldriver
1 min ago
add a comment |Â
up vote
1
down vote
awk -F, 'print $1, $2, $3,"n"$4'
You'd need to setOFS=,
as well in order to preserve the other delimiters
â steeldriver
9 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
... then change the last part to a simple concatenation$3 "n" $4
â steeldriver
5 mins ago
add a comment |Â
up vote
1
down vote
awk -F, -vOFS=, 'print $1,$2,$3; print $4; print ""' file
will produce your desired output
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
sed "s/,/n/3" file
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
...sed "s/,/n/3; G"
to add the double spacing
â steeldriver
1 min ago
add a comment |Â
up vote
3
down vote
sed "s/,/n/3" file
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
...sed "s/,/n/3; G"
to add the double spacing
â steeldriver
1 min ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
sed "s/,/n/3" file
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
sed "s/,/n/3" file
ETRYTUUI,YTYUIL,UIOKJHGFGH
34567898766
answered 15 mins ago
Goro
8,45754283
8,45754283
...sed "s/,/n/3; G"
to add the double spacing
â steeldriver
1 min ago
add a comment |Â
...sed "s/,/n/3; G"
to add the double spacing
â steeldriver
1 min ago
...
sed "s/,/n/3; G"
to add the double spacingâ steeldriver
1 min ago
...
sed "s/,/n/3; G"
to add the double spacingâ steeldriver
1 min ago
add a comment |Â
up vote
1
down vote
awk -F, 'print $1, $2, $3,"n"$4'
You'd need to setOFS=,
as well in order to preserve the other delimiters
â steeldriver
9 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
... then change the last part to a simple concatenation$3 "n" $4
â steeldriver
5 mins ago
add a comment |Â
up vote
1
down vote
awk -F, 'print $1, $2, $3,"n"$4'
You'd need to setOFS=,
as well in order to preserve the other delimiters
â steeldriver
9 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
... then change the last part to a simple concatenation$3 "n" $4
â steeldriver
5 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
awk -F, 'print $1, $2, $3,"n"$4'
awk -F, 'print $1, $2, $3,"n"$4'
answered 13 mins ago
TNT
346313
346313
You'd need to setOFS=,
as well in order to preserve the other delimiters
â steeldriver
9 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
... then change the last part to a simple concatenation$3 "n" $4
â steeldriver
5 mins ago
add a comment |Â
You'd need to setOFS=,
as well in order to preserve the other delimiters
â steeldriver
9 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
... then change the last part to a simple concatenation$3 "n" $4
â steeldriver
5 mins ago
You'd need to set
OFS=,
as well in order to preserve the other delimitersâ steeldriver
9 mins ago
You'd need to set
OFS=,
as well in order to preserve the other delimitersâ steeldriver
9 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
@steeldriver but it will not remove the third comma as requested?
â TNT
6 mins ago
... then change the last part to a simple concatenation
$3 "n" $4
â steeldriver
5 mins ago
... then change the last part to a simple concatenation
$3 "n" $4
â steeldriver
5 mins ago
add a comment |Â
up vote
1
down vote
awk -F, -vOFS=, 'print $1,$2,$3; print $4; print ""' file
will produce your desired output
add a comment |Â
up vote
1
down vote
awk -F, -vOFS=, 'print $1,$2,$3; print $4; print ""' file
will produce your desired output
add a comment |Â
up vote
1
down vote
up vote
1
down vote
awk -F, -vOFS=, 'print $1,$2,$3; print $4; print ""' file
will produce your desired output
awk -F, -vOFS=, 'print $1,$2,$3; print $4; print ""' file
will produce your desired output
answered 5 mins ago
glenn jackman
48.7k466105
48.7k466105
add a comment |Â
add a comment |Â
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
Simon Q is a new contributor. Be nice, and check out our Code of Conduct.
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%2f474882%2fadd-new-line-after-fourth-comma%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