我对Linux很新,我仍然在学习这些命令。我想要做的就是格式化我的.txt文件。我该如何grep/awk?
这里是我的文件看起来像:
hello hello
goodbye goodbye
random random
example example
last last
所有我想要做的就是删除空格,并用分号替换它。
例如:
hello:hello
goodbye:goodbye
random:random
example:example
last:last
我不知道是什么命令将完成这个任务,我敢肯定它的grep或awk的。如果有人能帮助我解决这个问题,那将会很棒。谢谢,所有帮助表示赞赏。
此问题似乎是脱离主题,因为它属于unix.stackexchange.com。 – Barmar
[File Formatting:Confusion using awk NR Variable]的可能重复(http://stackoverflow.com/questions/7941997/file-formatting-confusion-using-awk-nr-variable) – jww