#!/usr/bin/perl -w
use strict;
use Lingua::EN::NameCase qw( nc );
#Where the files are located...
my $Location = 'z:/bpermits/data2007/test/marchpermits.txt';
my $OutFile = 'z:/bpermits/data2007/test/output.txt';
#Open the files......
open(PERMSIN, $Location) or die "unable to open $Location: $!";
open(OUT, ">$OutFile") or die "unable to open $OutFile: $!";
#Read in the file, using a loop........
my @columns = qw( Permit_Number Street_Number Street_Prefix Street_Name Street_Suffix Lot
Block Issue_Date Proposed_Use_Code Permission_To_Code Square_Feet Estimated_Cost
Units Subdivision Zoning
Contractor_Name Contractor_Add1 Contractor_Add2 Contractor_City Contractor_State Contractor_Zip
Contractor_Phone1 Contractor_Phone2
Owner_Name Owner_Add1 Owner_Add2 Owner_City Owner_State Owner_Zip Owner_Phone );
while( my $line = ) {
chomp( $line );
# populate the hash %thisrecord with the column names and the values from this line
my @fields = split( /,/, $line );
my %thisrecord = map { $columns[$_] => $fields[$_] } ( 0 .. $#fields );
my @data = ();
push @data, \%thisrecord;
}