hmm... if it's such a problem, then I would store every person on one line each, seperated with a <tab>, then when reading in from the file, you could do it like:
Code:
/*
Some code here which I wont reveal
maybe a main and some struct definition
*/
int people_counter = 0;
while(!feof(file_pointer))
{
/*
yea yea, I know fscanf() is insecure when it comes to
buffer overflow, but it was the first thing that came to me
*/
fscanf(file_pointer, "%s\t%s\t%s\t%d\t%d\t%s\t%d\n",
&x[people_counter].name, &x[people_counter].ssn,
&x[people_counter].city, &x[people_counter].age,
&x[people_counter].weight, &x[people_counter].eyes,
&x[people_counter].income);
people_counter++;
}
/*
here you can sum up the age and such,
using people_counter as the number to devide with
*/
bare in mind, none of the above has been tested, I wont say it's the correct thing to do, just a way to get your thoughts going, in what ways this might be solved.