[VIM]處理檔案中不特定數量無意義空行 & how to replace ^M with vim
https://stackoverflow.com/questions/16414410/delete-empty-lines-using-sed 不會保留縮排空行,需要只能砍空超過一行的 https://stackoverflow.com/questions/12598916/how-to-use-sed-to-remove-only-double-empty-lines 處理檔案中不特定數量無意義空行 sed 'N;/^\n$/D;P;D;' main.i > main3.i how to replace ^M with vim : 1.顯示^M: e ++ff=unix 2.取代:24,39s/\r$//g 3.改回不顯示: e ++ff=dos sed -i + backup file sed - i . bak '/pattern to match/d' ./ infile