Thursday, October 11, 2012

Remove duplicate words or patterns inside lines

I have this type of file (plain text) :

sometext *sometext* @me &project1 *@me*
&project2 sometext *&project2* @john @me
something @john &project2
sometext #1 @me something else *#1*

and I would like to remove all inside-a-line duplicates so as to obtain :

sometext @me &project1
sometext &project2 @john @me
something @john &project2
sometext #1 @me something else

btw, the order of items (sometext, #, @ or &) do not matter, as long as they
are unique per line

Is it possible to do that ? This is for me out of reach...



--
View this message in context: http://vim.1045645.n5.nabble.com/Remove-duplicate-words-or-patterns-inside-lines-tp5711215.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
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: