Assuming dates can be different for the same match of the same word, and you want to keep the one that appears first in the file, then this should work (make sure your file ends with a new line for this):
- Go to the Replace dialog box (you can do Ctrl + F and go to the replacement tab)
- In the "search mode" at the bottom, select "Regular Expression" (make sure that ". Matches the new line" is not selected)
- In the "Find What:" field, enter
(\s*\w+ )(.*\r\n)((.*\r\n)*)\1.*\r\n
- In the field "Replace with:" enter
\1\2\3
- Click Replace until more cases appear (Replace All does not seem to work for this, there may be a better regular expression for which it will work, but I did not find it).
I tested this in a file:
testing330 05:09-24/08 whatever 10:55-25/08 testing 15:57-26/08 testing667 19:22-30/08 linux 00:29-31/08 testing330 00:29-31/08 windows 12:25-31/08
and the result:
testing330 05:09-24/08 whatever 10:55-25/08 testing 15:57-26/08 testing667 19:22-30/08 linux 00:29-31/08 windows 12:25-31/08
source share