1.先對檔案内容排序:cat 1.txt |sort > 2.txt 儲存到2.txt中
2.使用vim打開2.txt 執行替換指令:
替換空格:%s/ //g
替換tab:%s/^i//g (注意:^i 是直接按鍵盤是的tab鍵)
替換$: %s/^m//g (注意:^m 是按ctrl+v 再按enter鍵)
3.cat 2.txt | uniq > 3.txt
本文為eliot原創,轉載請注明出處:
1.先對檔案内容排序:cat 1.txt |sort > 2.txt 儲存到2.txt中
2.使用vim打開2.txt 執行替換指令:
替換空格:%s/ //g
替換tab:%s/^i//g (注意:^i 是直接按鍵盤是的tab鍵)
替換$: %s/^m//g (注意:^m 是按ctrl+v 再按enter鍵)
3.cat 2.txt | uniq > 3.txt
本文為eliot原創,轉載請注明出處: