# HG changeset patch # User Simon Howkins # Date 1247564877 -3600 # Node ID 4f2482f1dd48f8747b6d9dbb12736c719eb2a29d # Parent 2719a5d09e27a6b7c81daa1314d99922e410eca1 Added sorting and removal of duplicates from TSV files. diff -r 2719a5d09e27 -r 4f2482f1dd48 common/build.xml --- a/common/build.xml Mon Jul 13 18:03:32 2009 +0100 +++ b/common/build.xml Tue Jul 14 10:47:57 2009 +0100 @@ -818,7 +818,20 @@ - + + + + + + + + + + + + + + diff -r 2719a5d09e27 -r 4f2482f1dd48 common/tools/sortUnique.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/sortUnique.pl Tue Jul 14 10:47:57 2009 +0100 @@ -0,0 +1,13 @@ +#!perl -w +use strict; +# Sorts the input, removes duplicates, and outputs it + +# Read it +my @content = <>; + +# Sort it, and grep to remove duplicates +my $previous = "\n\n"; +@content = grep {$_ ne $previous && ($previous = $_, 1) } sort @content; + +# Write it +print @content;