maybe you should check first the string's length before using the substring method to avoid the OutOfBounds exception. :)
dimasalang
Junior Poster in Training
76 posts since Nov 2010
Reputation Points: 11
Solved Threads: 12
Skill Endorsements: 2
Splitting on blanks is not such a good idea.
The file format is defined by columns, so that's how you should parse it. Splitting on blanks will fail if any of the data fields contain an embedded blank, eg San Juan on line 3.
The best answer is to substring according to the file spec, but test the length of the line before substringing the capital.
JamesCherrill
... trying to help
8,530 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,456
Skill Endorsements: 30