1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Find duplicate lines in text file

Discussion in 'Support' started by nikbackm, Jan 2, 2014.

  1. nikbackm

    Joined:
    May 30, 2008
    Messages:
    201
    Likes Received:
    1
    Does TCC provide a simple and straightforward way to find duplicate lines in a text file?

    It seems that TPIPE /dup would easily take care of it, but it's a little too advanced for me in that it finds duplicate lines (as determined by the starting column and length) over the whole file.

    In this case I am only interested in CONSECUTIVE duplicate lines which it does not seem to support. Not in an obvious way at least.

    (I am aware that this case would be easy to handle with a simple loop in a batch file, but having direct support would be easier and faster. I guess an external tool like awk would also take care of it, but using only TCC would be preferable).

    ETA: After trying out some external tools I found that applying uniq (from UnxUtils) without sorting the file first does exactly what I want. So that works well for me.

    It would still be interesting to know if you can do the same using only built-in TCC functionality.
     
    #1 nikbackm, Jan 2, 2014
    Last edited: Jan 2, 2014

Share This Page