Tuesday, April 15, 2008

Remove repeated lines

Unix command:
$ uniq input.txt > result.txt
or
(sorted output)
$ sort -u input.txt > result.txt

Perl:
open (FH,$ARGV[0]) or die ("No input file\n");
read (FH,$file,-s $ARGV[0]);
$file =~ s/^(.*[\n\r]+)\1+/$1/mg;
print $file;


or
cat a.txt | perl -ne 'print unless($s{$_}++)'

Monday, March 31, 2008

Two useful VC2005 add-on

From Visual Studio stuff.
VSFileFinder2005 can add a file listing box and a filter text field for you to find files in solution quickly and then know where the file is located (in which project and in which directory)

VSTabs is also a good utility but it only works for VC2003. I do not find related free add-on for VC2005.

BTW, Visual Assist X - an add-in for Visual Studio by Whole Tomato Software is the best add-on I have ever used. But it is not for free.