From: Ben Ostrowsky Date: Wed, 30 Jun 2010 13:56:10 +0000 (+0000) Subject: Better parsing of city/state X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=3cca0cd35b61558f55882a5c79df545b9d9831c7 Better parsing of city/state git-svn-id: svn://nox.esilibrary.com/migration-tools@703 eee7cc8d-164e-4af6-8e1b-092a69004917 --- diff --git a/unicorn/unicorn_patrons_to_tsv.pl b/unicorn/unicorn_patrons_to_tsv.pl index 1522d29..d97b55f 100755 --- a/unicorn/unicorn_patrons_to_tsv.pl +++ b/unicorn/unicorn_patrons_to_tsv.pl @@ -124,9 +124,9 @@ for (my $u = 0; $u < @records; $u++) { $records[$u]{'l_' . $a . '_' . $f} = $records[$u]{uc('USER_' . $a . '.' . $f)}; } $records[$u]{'l_' . $a . '_std_line1'} = $records[$u]{'USER_' . uc($a) . '.STREET'}; - if ((defined $records[$u]{'USER_' . uc($a) . '.CITY/STATE'}) && ($records[$u]{'USER_' . uc($a) . '.CITY/STATE'} =~ m/^(.*), (.*)$/)) { + if ((defined $records[$u]{'USER_' . uc($a) . '.CITY/STATE'}) && ($records[$u]{'USER_' . uc($a) . '.CITY/STATE'} =~ m/^(.*),(\s*)(.*)$/)) { $records[$u]{'l_' . $a . '_std_city'} = $1; - $records[$u]{'l_' . $a . '_std_state'} = $2; + $records[$u]{'l_' . $a . '_std_state'} = $3; } $records[$u]{'l_' . $a . '_std_zip'} = $records[$u]{'USER_' . uc($a) . '.ZIP'};