#!d:/Perl/bin/perl
##!/usr/bin/perl

use lib 'd:/Programs/Perl/lib';

use strict;
#use warnings;
#use CGI::Carp qw(fatalsToBrowser);

use Utils;
use JFile;

my $InFile = '20170516STAC10-announce-Merged.csv';
my $OutFile = '20170516STAC10-announce.csv';

my %h;
my $in = JFile->new($InFile, 'r') or die "$!: Can not read [$InFile]\n";

$in->ReadLine();
while(1) {
	my $l = $in->ReadLine();
	last if(!$l);
	
	Utils::DelSpace($l);
	if($h{$l}) {
		next;
	}
	else {
		$h{$l}++;
	}
}

$in->Close();

my $out = JFile->new($OutFile, "w") or die "$!: Can not write to [$OutFile].\n";

$out->print("EMail\n");
foreach my $key (sort keys %h) {
	next if($key eq '');
	$out->print("$key\n");}

$out->Close();

exit;
