Skip to content

Instantly share code, notes, and snippets.

@s-aska
Created August 1, 2011 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-aska/1117672 to your computer and use it in GitHub Desktop.
Save s-aska/1117672 to your computer and use it in GitHub Desktop.
zip
my $zip;
open my $fh, "<:encoding(cp932)", $ken;
while (my $row = $csv->getline($fh)) {
next if $zip->{$row->[2]};
$zip->{$row->[2]}++;
$model->insert( 'minotaur_zip', {
zip => $row->[2],
pref => substr($row->[0], 0, 2),
address1 => $row->[7],
address2 => $row->[8]
} );
}
close $fh;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment