I want to ask how to delete repeated lines in vim. For now, I have a file which contained 12740 lines. There are only 98 unique lines, and each line is duplicated 129 times.
I have tried:
g/^\(.*\)$\n\1$/d
But my problem is, some unique lines are the same to each other, I don't know which lines are those.
When I input that command, my file becomes 95 lines, not 98 which I want. (3 lines are the same to each other, I guess, so it's also deleted).
Any other solution?
I'll edit if my question is still not clear enough.
My file:
-0.00697568
- line 1
-0.00697568
- line 2
...
0.00697568
- line 131
0.00697568
- line 132
0.00697568
- line 133
...
0.020909881
- line 261
0.020909881
- line 262
...
And so on.
I need to keep the 130n+1 line, from n=0 until n=97.
Edit I need the lines to keep their order so a solution sorting the lines would not be an acceptable one.
qaq
thenqa129dd@aq
then@a
should do the trick.uniq
would have done).