Removing last blank line

前端 未结 5 1512
礼貌的吻别
礼貌的吻别 2021-02-12 14:50

There is a para break at the end of my .csv file. I tried to remove the blank line that is at the end of the file using the following command.

sed -i \'/^$/d\' c         


        
5条回答
  •  北荒
    北荒 (楼主)
    2021-02-12 15:02

    Found this ages ago somewhere and saved the snippet. Do not ask me how it works:

    perl -i -pe "chomp if eof" combined.csv
    

提交回复
热议问题