Remove Duplicate Line in Vim?

后端 未结 9 1071
有刺的猬
有刺的猬 2021-01-15 06:19

I\'m trying to use VIM to remove a duplicate line in an XML file I created. (I can\'t recreate the file because the ID numbers will change.)

The file looks something

9条回答
  •  粉色の甜心
    2021-01-15 06:54

    instead of using vim you do something like

    sort filename | uniq -c | grep -v "^[ \t]*1[ \t]"
    

    to figure out what is the duplicate line and then just use normal search to visit it and delete it

提交回复
热议问题