我有一个很大的csv文件。您将如何,
用sed(或类似功能)删除最后一个?
...
[11911,0,"BUILDER","2014-10-15","BUILDER",0,0],
[11912,0,"BUILDER","2014-10-15","BUILDER",0,0],
[11913,0,"BUILDER","2014-10-15","BUILDER",0,0],
]
所需的输出
...
[11911,0,"BUILDER","2014-10-15","BUILDER",0,0],
[11912,0,"BUILDER","2014-10-15","BUILDER",0,0],
[11913,0,"BUILDER","2014-10-15","BUILDER",0,0]
]
以下sed命令将删除每行的最后一次出现,但我希望每个文件都删除。
sed -e 's/,$//' foo.csv
也不起作用
sed '$s/,//' foo.csv