Created
January 24, 2014 13:42
-
-
Save three18ti/8597442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
770 | |
404 | |
718 | |
203 | |
901 | |
305 | |
312 | |
313 | |
215 | |
803 | |
757 | |
410 | |
504 | |
972 | |
713 | |
314 | |
201 | |
212 | |
213 | |
916 | |
415 | |
704 | |
206 | |
808 | |
216 | |
702 | |
414 | |
317 | |
214 | |
281 | |
334 | |
205 | |
318 | |
601 | |
203 | |
804 | |
402 | |
301 | |
904 | |
407 | |
850 | |
708 | |
502 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
201 | NJ | |
---|---|---|
202 | DC | |
203 | CT | |
204 | MB | |
205 | AL | |
206 | WA | |
207 | ME | |
208 | ID | |
209 | CA | |
210 | TX | |
211 | -- | |
212 | NY | |
213 | CA | |
214 | TX | |
215 | PA | |
216 | OH | |
217 | IL | |
218 | MN | |
219 | IN | |
224 | IL | |
225 | LA | |
226 | ON | |
228 | MS | |
229 | GA | |
231 | MI | |
234 | OH | |
236 | BC | |
239 | FL | |
240 | MD | |
242 | -- | |
246 | -- | |
248 | MI | |
250 | BC | |
251 | AL | |
252 | NC | |
253 | WA | |
254 | TX | |
256 | AL | |
260 | IN | |
262 | WI | |
264 | -- | |
267 | PA | |
268 | -- | |
269 | MI | |
270 | KY | |
276 | VA | |
278 | MI | |
281 | TX | |
283 | OH | |
284 | -- | |
289 | ON | |
301 | MD | |
302 | DE | |
303 | CO | |
304 | WV | |
305 | FL | |
306 | SK | |
307 | WY | |
308 | NE | |
309 | IL | |
310 | CA | |
311 | -- | |
312 | IL | |
313 | MI | |
314 | MO | |
315 | NY | |
316 | KS | |
317 | IN | |
318 | LA | |
319 | IA | |
320 | MN | |
321 | FL | |
323 | CA | |
325 | TX | |
330 | OH | |
331 | IL | |
334 | AL | |
336 | NC | |
337 | LA | |
339 | MA | |
340 | VI | |
341 | CA | |
345 | -- | |
347 | NY | |
351 | MA | |
352 | FL | |
360 | WA | |
361 | TX | |
369 | CA | |
380 | OH | |
385 | UT | |
386 | FL | |
401 | RI | |
402 | NE | |
403 | AB | |
404 | GA | |
405 | OK | |
406 | MT | |
407 | FL | |
408 | CA | |
409 | TX | |
410 | MD | |
411 | -- | |
412 | PA | |
413 | MA | |
414 | WI | |
415 | CA | |
416 | ON | |
417 | MO | |
418 | QC | |
419 | OH | |
423 | TN | |
424 | CA | |
425 | WA | |
430 | TX | |
431 | MB | |
432 | TX | |
434 | VA | |
435 | UT | |
438 | QC | |
440 | OH | |
441 | -- | |
442 | CA | |
443 | MD | |
450 | QC | |
456 | -- | |
464 | IL | |
469 | TX | |
470 | GA | |
473 | -- | |
475 | CT | |
478 | GA | |
479 | AR | |
480 | AZ | |
484 | PA | |
500 | -- | |
501 | AR | |
502 | KY | |
503 | OR | |
504 | LA | |
505 | NM | |
506 | NB | |
507 | MN | |
508 | MA | |
509 | WA | |
510 | CA | |
511 | -- | |
512 | TX | |
513 | OH | |
514 | QC | |
515 | IA | |
516 | NY | |
517 | MI | |
518 | NY | |
519 | ON | |
520 | AZ | |
530 | CA | |
539 | OK | |
540 | VA | |
541 | OR | |
551 | NJ | |
555 | -- | |
557 | MO | |
559 | CA | |
561 | FL | |
562 | CA | |
563 | IA | |
564 | WA | |
567 | OH | |
570 | PA | |
571 | VA | |
573 | MO | |
574 | IN | |
575 | NM | |
580 | OK | |
585 | NY | |
586 | MI | |
587 | AB | |
600 | -- | |
601 | MS | |
602 | AZ | |
603 | NH | |
604 | BC | |
605 | SD | |
606 | KY | |
607 | NY | |
608 | WI | |
609 | NJ | |
610 | PA | |
611 | -- | |
612 | MN | |
613 | ON | |
614 | OH | |
615 | TN | |
616 | MI | |
617 | MA | |
618 | IL | |
619 | CA | |
620 | KS | |
623 | AZ | |
626 | CA | |
627 | CA | |
628 | CA | |
630 | IL | |
631 | NY | |
636 | MO | |
639 | SK | |
641 | IA | |
646 | NY | |
647 | ON | |
649 | -- | |
650 | CA | |
651 | MN | |
657 | CA | |
660 | MO | |
661 | CA | |
662 | MS | |
664 | -- | |
669 | CA | |
670 | MP | |
671 | GU | |
678 | GA | |
679 | MI | |
681 | WV | |
682 | TX | |
684 | -- | |
689 | FL | |
700 | -- | |
701 | ND | |
702 | NV | |
703 | VA | |
704 | NC | |
705 | ON | |
706 | GA | |
707 | CA | |
708 | IL | |
709 | NL | |
710 | -- | |
711 | -- | |
712 | IA | |
713 | TX | |
714 | CA | |
715 | WI | |
716 | NY | |
717 | PA | |
718 | NY | |
719 | CO | |
720 | CO | |
724 | PA | |
727 | FL | |
731 | TN | |
732 | NJ | |
734 | MI | |
737 | TX | |
740 | OH | |
747 | CA | |
754 | FL | |
757 | VA | |
758 | -- | |
760 | CA | |
762 | GA | |
763 | MN | |
764 | CA | |
765 | IN | |
767 | -- | |
769 | MS | |
770 | GA | |
772 | FL | |
773 | IL | |
774 | MA | |
775 | NV | |
778 | BC | |
779 | IL | |
780 | AB | |
781 | MA | |
784 | -- | |
785 | KS | |
786 | FL | |
787 | PR | |
800 | -- | |
801 | UT | |
802 | VT | |
803 | SC | |
804 | VA | |
805 | CA | |
806 | TX | |
807 | ON | |
808 | HI | |
809 | -- | |
810 | MI | |
811 | -- | |
812 | IN | |
813 | FL | |
814 | PA | |
815 | IL | |
816 | MO | |
817 | TX | |
818 | CA | |
819 | QC | |
822 | -- | |
828 | NC | |
829 | -- | |
830 | TX | |
831 | CA | |
832 | TX | |
833 | -- | |
835 | PA | |
843 | SC | |
844 | -- | |
845 | NY | |
847 | IL | |
848 | NJ | |
849 | -- | |
850 | FL | |
855 | -- | |
856 | NJ | |
857 | MA | |
858 | CA | |
859 | KY | |
860 | CT | |
862 | NJ | |
863 | FL | |
864 | SC | |
865 | TN | |
866 | -- | |
867 | YT | |
868 | -- | |
869 | -- | |
870 | AR | |
872 | IL | |
876 | -- | |
877 | -- | |
878 | PA | |
880 | -- | |
881 | -- | |
882 | -- | |
888 | -- | |
898 | -- | |
900 | -- | |
901 | TN | |
902 | NS | |
903 | TX | |
904 | FL | |
905 | ON | |
906 | MI | |
907 | AK | |
908 | NJ | |
909 | CA | |
910 | NC | |
911 | -- | |
912 | GA | |
913 | KS | |
914 | NY | |
915 | TX | |
916 | CA | |
917 | NY | |
918 | OK | |
919 | NC | |
920 | WI | |
925 | CA | |
927 | FL | |
928 | AZ | |
931 | TN | |
935 | CA | |
936 | TX | |
937 | OH | |
939 | PR | |
940 | TX | |
941 | FL | |
947 | MI | |
949 | CA | |
951 | CA | |
952 | MN | |
954 | FL | |
956 | TX | |
957 | NM | |
959 | CT | |
970 | CO | |
971 | OR | |
972 | TX | |
973 | NJ | |
975 | MO | |
976 | -- | |
978 | MA | |
979 | TX | |
980 | NC | |
984 | NC | |
985 | LA | |
989 | MI | |
999 | -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.010; | |
use strict; | |
use warnings; | |
use DBI; | |
my $areacodes = 'areacodes_list.csv'; | |
my $song_acs = 'song_acs.txt'; | |
open my $FHIN, '<', $song_acs or die "Could not open $song_acs\n$!"; | |
my $dbh = DBI->connect( | |
"dbi:CSV:", undef, undef, { | |
f_dir => '.', | |
f_ext => '.csv/r', | |
r_enc => 'utf-8' | |
} | |
); | |
my $sth = $dbh->prepare("SELECT state FROM areacodes_list where areacode = ?"); | |
my %mappings; | |
while (my $line = <$FHIN>) { | |
chomp $line; | |
$sth->execute($line); | |
my $state = $sth->fetchrow; | |
push @{$mappings{$state}}, $line; | |
} | |
use Data::Dump; | |
dd \%mappings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
AL => [334, 205], | |
CA => [213, 916, 415], | |
CT => [203, 203], | |
FL => [305, 904, 407, 850], | |
GA => [770, 404], | |
HI => [808], | |
IL => [312, 708], | |
IN => [317], | |
KY => [502], | |
LA => [504, 318], | |
MD => [410, 301], | |
MI => [313], | |
MO => [314], | |
MS => [601], | |
NC => [704], | |
NE => [402], | |
NJ => [201], | |
NV => [702], | |
NY => [718, 212], | |
OH => [216], | |
PA => [215], | |
SC => [803], | |
TN => [901], | |
TX => [972, 713, 214, 281], | |
VA => [757, 804], | |
WA => [206], | |
WI => [414], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment