Removing ^M from shell script and realigning columns

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question
















  • 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














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.







share|improve this question
















  • 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












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.







share|improve this question












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.









share|improve this question











share|improve this question




share|improve this question










asked Mar 31 at 17:59









pastingwizard

61




61







  • 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












  • 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







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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay