I would like to know how to extract a list of unique lines from a text file. Preferably through Cygwin.
+1
A:
Your question is somewhat unclear. If you want to eliminate all duplicate lines from a text file you can do something like this:
cat file.txt | sort | uniq
bluebrother
2009-04-20 21:40:28
Useless use of cat. no cookie for you either.
simon
2009-04-20 22:48:06
+3
A:
Since the original question referenced Cygwin, which is Windows specific, I'll mention that Luis' answer works just as well using the GNU utilities for Win32 sort
. I use the GNU ports off a USB key when I'm working on a machine that I don't want to install Cygwin on, or downloading and installing Cygwin seems like too heavy a solution for the problem I'm trying to solve.
Grant Wagner
2009-04-20 21:58:36