我對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