Need an inner loop to process lines from a file that have the same account number abd I cant seem to make it work.
Here is the scenario:
a text file containing an ordered listing of names. I am using while (fgets( filler, 115, FilePtr)) to read
each line of the file, with each line being no longer than 115 characters. I have no problem to read the lines and assign the read values to appropiate char or int type variables. I am also using atof to change some of the read values to double type numbers, so that they can be added as subtotals.
But what I want to do is to process a subset of the file, so that each time the account number changes, I can write the subtotals of each account number to a another file, and this is the part that I am hung up on. I have tried various if statements, while loops etc but I cant seem to get the right algorithm.
I still want to process the entire file, I just need a way to process each subset of data within the file.