Wednesday, July 6, 2011

Deleting duplicate lines _without_ sorting

Hi vim users,

i got a longer SQL script with duplicate inserts :/
I'd like to remove those without sorting the whole file.
It's possible to match the lines by a pattern.

One solution might be to insert the line number at the end of the line,
sort the file,
delete duplicate lines ignoring the linenumber,
move the line number to the start of the line,
sort,
remove the line number.

Is there a more simple way?

thanks,
Stefan

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: