Ok guys just one more question about reading file and that's it
My code looks alright to me but I'm getting NumberFormatException for some reasons and I can't figure out what's happening.
So I'm reading the file like this in my main
So I trim the leading and trailing space before adding it to my arraylist.
Then in my constructor class I have the following just before parse the records.
So I split the reading with one or more white space and then it goes through a loop and replaces all non digits with "" and I keep "." and "-" for decimal and negative numbers.
This was working fine last night and I don't remember changing anything but all of a sudden it stopped working. I'm so confused cause if there is any sign or letter attached to a number it will works fine and replaces them. but if there is any
word on it's own in the header it gives exception. It says NumberFormatException strin "".
Maybe when it replaces a non digit with ("") it causes the exception?? somewhere some String being converted to int but I have no clue.
and the other problem is my no data sign is like "---" if I keep "-" for negatives number it won't be replaced and it gives me exception !!