Bash paste -d “ ” command outputting a return separated file

久未见 提交于 2019-12-13 04:03:57

问题


I am trying to combine two text files each with a single column into a third text file that has both of the columns separated by a space.

One text file looks something like the following (shortened for the purpose of this explanation):

-53.46
-50.45
-47.44

The second text file looks something like this (also shortened for this explanation):

1.71
3.42
5.13

and I want to combine them to get a file:

-53.46 1.71
-50.45 3.42
-47.44 5.13

Currently I am trying the method:

paste -d " " file1 file2 > file3

but then when I view the file with the less command the columns are separated by

^M

And if I view them in gedit or similar they are each on a different line with a space at the start of each line.

Please send help.

来源:https://stackoverflow.com/questions/51150503/bash-paste-d-command-outputting-a-return-separated-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!