#!/usr/bin/perl

open (FH, "$ARGV[0]");
while (<FH>) {
	chop($_);
	@lines = (@lines, $_);
}
close (FH);

foreach (@lines){
	s/^\s+//;
	s/\(?(\d\d\d)\)?\s*(\d{3})[\s-]*(\d{4})/\1-\2-\3/;
	}

open (OUT,">$ARGV[0]");
foreach(@lines){
print OUT "$_\n";
}
close (OUT);
