diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /bin/cch_tax_tool | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'bin/cch_tax_tool')
-rwxr-xr-x | bin/cch_tax_tool | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/bin/cch_tax_tool b/bin/cch_tax_tool deleted file mode 100755 index 6261363d6..000000000 --- a/bin/cch_tax_tool +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -# this tool manipulates fixed length cch tax files by comparing the -# update files in the $update_dir to the initial install files -# in the $init_dir -# -# it produces .DOIT files in $update_dir which are suitable for -# syncing a database initialzed with the files in $init_dir to -# the state represented by the files in $update_dir -# -# how one acquires update files from cch that overlap with initial -# full install remains a mystery - -my $init_dir = "cchinit/"; -my $update_dir = "cchupdate/"; - -foreach my $file (qw (CODE DETAIL PLUS4 GEOCODE TXMATRIX ZIP)) { - my $tfile = $update_dir. $file. "T"; - $tfile = $update_dir. "TXMATRIT" if $tfile =~ /TXMATRIXT$/; - open FILE, "$tfile.TXT" or die "Can't open $tfile.TXT\n"; - open INSERT, ">$tfile.INS" or die "Can't open $tfile.INS\n"; - open DELETE, ">$tfile.DEL" or die "Can't open $tfile.DEL\n"; - while(<FILE>){ - chomp; - print INSERT "$_\n" if s/I$//; - print DELETE "$_\n" if s/D$//; - } - close FILE; - close INSERT; - close DELETE; - system "sort $tfile.INS > $tfile.INSSORT"; - system "sort $tfile.DEL > $tfile.DELSORT"; - system "sort $init_dir$file.txt > $tfile.ORGINSSORT"; - system "comm -12 $tfile.INSSORT $tfile.ORGINSSORT > $tfile.PREINS"; - system "comm -23 $tfile.INSSORT $tfile.ORGINSSORT > $tfile.2BEINS"; - system "comm -23 $tfile.DELSORT $tfile.ORGINSSORT > $tfile.PREDEL"; - system "comm -12 $tfile.DELSORT $tfile.ORGINSSORT > $tfile.2BEDEL"; -} - -foreach my $file (qw (CODET DETAILT PLUS4T GEOCODET TXMATRIT ZIPT)) { - my $tfile = $update_dir. $file; - $tfile = "TXMATRIT" if $tfile eq "TXMATRIXT"; - open INSERT, "$tfile.2BEINS" or die "Can't open $tfile.2BEINS\n"; - open DELETE, "$tfile.2BEDEL" or die "Can't open $tfile.2BEDEL\n"; - open FILE, ">$tfile.DOIT" or die "Can't open $tfile.DOIT\n"; - while(<INSERT>){ - chomp; - print FILE $_, "I\n"; - } - while(<DELETE>){ - chomp; - print FILE $_, "D\n"; - } - close FILE; - close INSERT; - close DELETE; -} |