Last active
December 14, 2015 05:09
-
-
Save tec27/5033626 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package ziptable; | |
/** | |
* | |
* @author Dale Diaz | |
*/ | |
import java.util.Scanner; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
public class ZipTable { | |
public static void main(String[] args) { | |
BufferedReader br; | |
try{ | |
br = new BufferedReader(new FileReader("C:\\Users\\Stropheum\\Documents\\ziptable.txt")); | |
} | |
catch(FileNotFoundException fnfe){ | |
System.out.println(fnfe.getMessage()); | |
} | |
String line; | |
while((line = br.readLine()) != null) { | |
Scanner scanner = new Scanner(line); | |
String abbreviation = scanner.next(); | |
String name = scanner.next(); | |
String next; | |
while(scanner.hasNext()) { | |
next = scanner.next(); | |
if(next.matches("\d+")) break; | |
else name = name + " " + next; | |
} | |
List<String> zipCodes = new ArrayList<String>(); | |
zipCodes.add(next); | |
while(scanner.hasNext()) { | |
zipCodes.add(scaner.next()); | |
} | |
// TODO: do some stuff with your results | |
} | |
} | |
} |
This file contains hidden or 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 Alabama 350-369 | |
AK Alaska 995-999 | |
AS American Samoa 967-967 | |
AZ Arizona 850-865 | |
AR Arkansas 716-729 755 | |
CA California 900-966 | |
CO Colorado 800-816 | |
CT Connecticut 060-069 | |
DE Delaware 197-199 | |
DC District of Columbia 200-205 | |
FM FS of Micronesia 969-969 | |
FL Florida 320-349 | |
GA Georgia 300-319 398-399 | |
GU Guam 969-969 | |
HI Hawaii 967-968 | |
ID Idaho 832-838 | |
IL Illinois 600-629 | |
IN Indiana 460-479 | |
IA Iowa 500-528 | |
KS Kansas 660-679 | |
KY Kentucky 400-427 | |
LA Louisiana 700-714 | |
ME Maine 039-049 | |
MH Marshall Islands 969-969 | |
MD Maryland 206-219 | |
MA Massachusetts 010-027 055 | |
MI Michigan 480-499 | |
MN Minnesota 550-567 | |
MS Mississippi 386-397 | |
MO Missouri 630-658 | |
MT Montana 590-599 | |
NE Nebraska 680-693 | |
NV Nevada 889-898 | |
NH New Hampshire 030-039 | |
NJ New Jersey 070-089 | |
NM New Mexico 870-884 | |
NY New York 005 063 090-149 | |
NC North Carolina 269-289 | |
ND North Dakota 580-588 | |
MP N. Mariana Islands 969-969 | |
OH Ohio 430-459 | |
OK Oklahoma 730-749 | |
OR Oregon 970-979 | |
PW Palau Island 969-969 | |
PA Pennsylvania 150-196 | |
PR Puerto Rico 006-009 | |
RI Rhode Island 028-029 | |
SC South Carolina 290-299 | |
SD South Dakota 570-577 | |
TN Tennessee 370-385 | |
TX Texas 750-799 885 | |
UT Utah 840-847 | |
VT Vermont 050-059 | |
VA Virginia 201 220-246 | |
VI Virgin Islands 008-008 | |
WA Washington 980-994 | |
WI Wisconsin 530-549 | |
WV West Virginia 247-268 | |
WY Wyoming 820-831 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment