Adjust columns in a table
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have this table which is messed up
DB Size_in_MB
foobar 11011.2
barfoo 4582.9
donkey 4220.8
shoryuken 555.9
hadouken 220.0
kong 214.8
super_mario_bros_p 211.1
there are unnecessary spaces between columns. I want to add |
and adjust the spaces between columns. I tried sed 's/t/|/g'
and sed 's/t/t|t/g'
but did not work
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
I want the table like this:
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
scripting text-formatting
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
I have this table which is messed up
DB Size_in_MB
foobar 11011.2
barfoo 4582.9
donkey 4220.8
shoryuken 555.9
hadouken 220.0
kong 214.8
super_mario_bros_p 211.1
there are unnecessary spaces between columns. I want to add |
and adjust the spaces between columns. I tried sed 's/t/|/g'
and sed 's/t/t|t/g'
but did not work
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
I want the table like this:
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
scripting text-formatting
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have this table which is messed up
DB Size_in_MB
foobar 11011.2
barfoo 4582.9
donkey 4220.8
shoryuken 555.9
hadouken 220.0
kong 214.8
super_mario_bros_p 211.1
there are unnecessary spaces between columns. I want to add |
and adjust the spaces between columns. I tried sed 's/t/|/g'
and sed 's/t/t|t/g'
but did not work
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
I want the table like this:
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
scripting text-formatting
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have this table which is messed up
DB Size_in_MB
foobar 11011.2
barfoo 4582.9
donkey 4220.8
shoryuken 555.9
hadouken 220.0
kong 214.8
super_mario_bros_p 211.1
there are unnecessary spaces between columns. I want to add |
and adjust the spaces between columns. I tried sed 's/t/|/g'
and sed 's/t/t|t/g'
but did not work
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
I want the table like this:
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
scripting text-formatting
scripting text-formatting
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 37 mins ago


Jeff Schaller
33.6k851113
33.6k851113
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 57 mins ago
Suzie
82
82
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Suzie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Try the command column
as follows:
cat file | sed 's/t/,|,/g' | column -s ',' -t
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
@Goro: also ran the command but did not work for me either. For mesed 's/s+/,|,/g'
did the trick.
– Thomas
44 mins ago
1
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Try the command column
as follows:
cat file | sed 's/t/,|,/g' | column -s ',' -t
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
@Goro: also ran the command but did not work for me either. For mesed 's/s+/,|,/g'
did the trick.
– Thomas
44 mins ago
1
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
add a comment |Â
up vote
3
down vote
accepted
Try the command column
as follows:
cat file | sed 's/t/,|,/g' | column -s ',' -t
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
@Goro: also ran the command but did not work for me either. For mesed 's/s+/,|,/g'
did the trick.
– Thomas
44 mins ago
1
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Try the command column
as follows:
cat file | sed 's/t/,|,/g' | column -s ',' -t
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
Try the command column
as follows:
cat file | sed 's/t/,|,/g' | column -s ',' -t
DB | Size_in_MB
foobar | 11011.2
barfoo | 4582.9
donkey | 4220.8
shoryuken | 555.9
hadouken | 220.0
kong | 214.8
super_mario_bros_p | 211.1
answered 55 mins ago
Goro
7,13253066
7,13253066
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
@Goro: also ran the command but did not work for me either. For mesed 's/s+/,|,/g'
did the trick.
– Thomas
44 mins ago
1
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
add a comment |Â
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
@Goro: also ran the command but did not work for me either. For mesed 's/s+/,|,/g'
did the trick.
– Thomas
44 mins ago
1
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
thank you but this is still doesn't work. the columns are not adjusted!
– Suzie
50 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
Hi @Suzie I just ran the command and the results as listed in my answer. Run the command on your original table!
– Goro
49 mins ago
@Goro: also ran the command but did not work for me either. For me
sed 's/s+/,|,/g'
did the trick.– Thomas
44 mins ago
@Goro: also ran the command but did not work for me either. For me
sed 's/s+/,|,/g'
did the trick.– Thomas
44 mins ago
1
1
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
Ah Ok my bad, it worked I was doing it on the second table. Thank you for help!
– Suzie
43 mins ago
add a comment |Â
Suzie is a new contributor. Be nice, and check out our Code of Conduct.
Suzie is a new contributor. Be nice, and check out our Code of Conduct.
Suzie is a new contributor. Be nice, and check out our Code of Conduct.
Suzie 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%2f473775%2fadjust-columns-in-a-table%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