Skip to content

Commit

Permalink
#173 Adding skip line for comment in CSV file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Dec 15, 2024
1 parent 6648e22 commit b2ef48a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ private HashMap<String, Integer> loadZipCodes2010Census() throws IOException {
String line;
while ((line = bufferedReader.readLine()) != null) {

final String[] zipCodePopulation = line.split(",");
if(!line.startsWith("#")) {
final String[] zipCodePopulation = line.split(",");

final String zipCode = zipCodePopulation[0];
final int population = Integer.parseInt(zipCodePopulation[1]);
final String zipCode = zipCodePopulation[0];
final int population = Integer.parseInt(zipCodePopulation[1]);

zipcodes.put(zipCode, population);
zipcodes.put(zipCode, population);
}

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 2010 Census zip code population
01001,16769
01002,29049
01003,10372
Expand Down

0 comments on commit b2ef48a

Please sign in to comment.