Hi people.
I wrote the code for this kind of problem. The solution is way easier. Come to very basics of the programming.
Create an Array List (or whichever Data Structure you are comfortable) to store Data .
Suppose you start considering data from line 8
Since you have 7 fields of data of which rain is the 6th field.
//Code is as follows
//You have whole data in a Array List
// rainfall data is there is ArrayList
//Now assuming you have complete list of data in your file including those of leap year
Since your starting year is 1908, we have to check whether it is a leap year
//create function to print data of all years
Sorry if there are bugs in code(Beginner here myself).
That's how the code will be. You can do all the variation in the code, it's easy job now.
I just gave you way around this problem.
Honestly speaking, it took me a month to come over a problem like this.
Hope i helped. (IF you need help, feel free to ask)
-------------------------------
Hardwork beats talent when talent fails to work hard