How should I parse this simple text file in Java?
- by Winston
I have a text file that looks like this:
grn129 agri-
ac-214 ahss
hud114 ahss
lov1150 ahss
lov1160 ahss
lov1170 ahss
lov1210 ahss
What is the best way to parse this file using Java if I want to create a HashMap with the first column as the key and the second column as the value.
Should I use the Scanner class? Try to read in the whole file as a string and split it?
What is the best way?