in reply to Seek, Copy & Paste

I'm not sure what OS you are in. But there is a unix command that does this for you.

comm -1 a.txt b.txt > c.txt

--
I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.

Replies are listed 'Best First'.
Re^2: Seek, Copy & Paste
by tachyon-II (Chaplain) on Nov 25, 2007 at 08:02 UTC

    And (somewhat amazingly) you can do the same on Win32 from the command line although it does take 3 more keystrokes.....

    findstr /g:a.txt b.txt > c.txt
Re^2: Seek, Copy & Paste
by toolic (Bishop) on Nov 25, 2007 at 13:56 UTC
    Keep in mind that the unix comm command requires its input files to be sorted first.
Re^2: Seek, Copy & Paste
by Anonymous Monk on Nov 25, 2007 at 15:15 UTC

    Maybe better to use grep for that:

    grep -f file_1 file_2 > file_3