#!/usr/local/bin/perl
open (IN, "formats.txt");

%cCode = ();

while (<IN>) {
	$line = $_;
	$line =~ tr/\n\r//d;

	if ($line =~ m|\[\(|) {
		$line =~ m|\[\((.+?)\)|;
		$line = $1;
	} else {
		$line =~ m|\[(.+?)\]|;
		$line = $1;
	}
	$line =~ s|^\s*(\s*?)\s*$|$1|;
	$cCode{$line}++;
}
close (IN);

foreach my $ccKey (sort keys(%cCode)) {
	print "$ccKey\n";
}
