i hav a ASCII file in which, at the beginning there is a header lins.
and then there r numerical lines, then again header llines with numerical lines...sequentially it follows.
i want to read these lines & header lines..
how can i loop on unknow no. of lines per header lines.
Read next line and try to read its content as a number. If you succeed then the line is numerical (or at least it starts with a number):
1 2 3 4 5 6 7 8
char line[1000];
while(...)
{
gets(line);
int n;
if( sscanf(line, "%d", &n) == 1 )
//then the line starts with a number
}
Or you may try to introduce a convension about header lines, for instance, all of them begin with '#'. Then you have only to analyze the first symbol of the next read line.