in reply to Remove unique lines from file

Can you help me to keep only these lines in which the preceding number appears only once? In the example above, I would keep the lines starting with 1,3 and 5.
That's seems contradictory. If you keep the lines starting with 1,3 and 5, then you keep the lines where the preceding number appears more than once.

Please explain better what you really want.

Je suis Charlie.

Replies are listed 'Best First'.
Re^2: Remove unique lines from file
by Lotus1 (Vicar) on Mar 21, 2015 at 16:43 UTC

    They seem to mean the lines where the previous line number only occurred one time. There was only one line with a 2 or a 4 at the front. That still doesn't explain why to keep lines starting with 1.

Re^2: Remove unique lines from file
by BillKSmith (Monsignor) on Mar 21, 2015 at 19:23 UTC
    Considering the title of the thread, I think he wants to keep lines whose leading number is unique. The confusion between "keep" and "remove" is probably one of viewpoint.
    Bill

      The difference between "keep" and "remove" is as large a gap as exists! Perhaps more of a problem of vocabulary than viewpoint?

      Dum Spiro Spero