Removing ^M from shell script and realigning columns
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a shell script that I am asking to print the columns I pasted together.
Then I'm asking it to realign the columns after its pasted and then take out the ^M character .
My code is
paste file1.1 file2.1 file3.1 > mega
column -t mega | tr -d \015
This is what I get
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
15.4 15.3 15.7
gge06001 gge06001 gge06001
30.8 30.6 30.3
19.2 21.1 23.5
1006.2 1006.6 1008
1012.7 1014.6 1014.1
36.2 36.1 36.6
38.944 38.944 38.944
107.71 107.71 107.71
8.411 8.433 8.434
37.084 36.705 36.508
7.537 7.621 7.546
28.198 27.623 27.574
212.52 210.51 208.08
68.1 68 67.6
What I want is
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
With all of the columns aligned like this with all the same words as the first one. I shortened it just for example.
What is the best way that I can make my script take the file and take out the hidden characters while realigning the columns back to columns? The files that I pasted were all one column each and all aligned previously, before the merge.
paste
add a comment |Â
up vote
1
down vote
favorite
I have a shell script that I am asking to print the columns I pasted together.
Then I'm asking it to realign the columns after its pasted and then take out the ^M character .
My code is
paste file1.1 file2.1 file3.1 > mega
column -t mega | tr -d \015
This is what I get
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
15.4 15.3 15.7
gge06001 gge06001 gge06001
30.8 30.6 30.3
19.2 21.1 23.5
1006.2 1006.6 1008
1012.7 1014.6 1014.1
36.2 36.1 36.6
38.944 38.944 38.944
107.71 107.71 107.71
8.411 8.433 8.434
37.084 36.705 36.508
7.537 7.621 7.546
28.198 27.623 27.574
212.52 210.51 208.08
68.1 68 67.6
What I want is
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
With all of the columns aligned like this with all the same words as the first one. I shortened it just for example.
What is the best way that I can make my script take the file and take out the hidden characters while realigning the columns back to columns? The files that I pasted were all one column each and all aligned previously, before the merge.
paste
2
what abouttr -d \015 <mega | column -t
â Jesse_b
Mar 31 at 18:01
@Jesse_b That's not a comment! Thay's an answer! Post one and ping me and I'll upvote...
â Fabby
Mar 31 at 20:28
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a shell script that I am asking to print the columns I pasted together.
Then I'm asking it to realign the columns after its pasted and then take out the ^M character .
My code is
paste file1.1 file2.1 file3.1 > mega
column -t mega | tr -d \015
This is what I get
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
15.4 15.3 15.7
gge06001 gge06001 gge06001
30.8 30.6 30.3
19.2 21.1 23.5
1006.2 1006.6 1008
1012.7 1014.6 1014.1
36.2 36.1 36.6
38.944 38.944 38.944
107.71 107.71 107.71
8.411 8.433 8.434
37.084 36.705 36.508
7.537 7.621 7.546
28.198 27.623 27.574
212.52 210.51 208.08
68.1 68 67.6
What I want is
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
With all of the columns aligned like this with all the same words as the first one. I shortened it just for example.
What is the best way that I can make my script take the file and take out the hidden characters while realigning the columns back to columns? The files that I pasted were all one column each and all aligned previously, before the merge.
paste
I have a shell script that I am asking to print the columns I pasted together.
Then I'm asking it to realign the columns after its pasted and then take out the ^M character .
My code is
paste file1.1 file2.1 file3.1 > mega
column -t mega | tr -d \015
This is what I get
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
15.4 15.3 15.7
gge06001 gge06001 gge06001
30.8 30.6 30.3
19.2 21.1 23.5
1006.2 1006.6 1008
1012.7 1014.6 1014.1
36.2 36.1 36.6
38.944 38.944 38.944
107.71 107.71 107.71
8.411 8.433 8.434
37.084 36.705 36.508
7.537 7.621 7.546
28.198 27.623 27.574
212.52 210.51 208.08
68.1 68 67.6
What I want is
gge0006x gge0006y gge0006z
12-30-2006 12-30-2006 12-30-2006
14:05:23 14:05:55 14:06:28
a69 a69 a69
With all of the columns aligned like this with all the same words as the first one. I shortened it just for example.
What is the best way that I can make my script take the file and take out the hidden characters while realigning the columns back to columns? The files that I pasted were all one column each and all aligned previously, before the merge.
paste
asked Mar 31 at 17:59
pastingwizard
61
61
2
what abouttr -d \015 <mega | column -t
â Jesse_b
Mar 31 at 18:01
@Jesse_b That's not a comment! Thay's an answer! Post one and ping me and I'll upvote...
â Fabby
Mar 31 at 20:28
add a comment |Â
2
what abouttr -d \015 <mega | column -t
â Jesse_b
Mar 31 at 18:01
@Jesse_b That's not a comment! Thay's an answer! Post one and ping me and I'll upvote...
â Fabby
Mar 31 at 20:28
2
2
what about
tr -d \015 <mega | column -t
â Jesse_b
Mar 31 at 18:01
what about
tr -d \015 <mega | column -t
â Jesse_b
Mar 31 at 18:01
@Jesse_b That's not a comment! Thay's an answer! Post one and ping me and I'll upvote...
â Fabby
Mar 31 at 20:28
@Jesse_b That's not a comment! Thay's an answer! Post one and ping me and I'll upvote...
â Fabby
Mar 31 at 20:28
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f434716%2fremoving-m-from-shell-script-and-realigning-columns%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
2
what about
tr -d \015 <mega | column -t
â Jesse_b
Mar 31 at 18:01
@Jesse_b That's not a comment! Thay's an answer! Post one and ping me and I'll upvote...
â Fabby
Mar 31 at 20:28