I am working in C on a text file that contains METAR data.
I would like to count how many entries file contains and still I don't know where to start and how to go through.
Counting lines is out of option, as METAR files may contain some additional 'commented' header data, so my first thought was to count all "METAR"s as in every entry there is just one. And still there is a problem of this commented header - who knows if someone didn't put some "METAR" in there?
Question
Action Hank
I am working in C on a text file that contains METAR data.
I would like to count how many entries file contains and still I don't know where to start and how to go through.
Counting lines is out of option, as METAR files may contain some additional 'commented' header data, so my first thought was to count all "METAR"s as in every entry there is just one. And still there is a problem of this commented header - who knows if someone didn't put some "METAR" in there?
Still, I do not know how, C is a new area for me.
There is a link to METAR on wikipedia: METAR
and some of my sample file:
And as you can see there might be some problems
Maybe counting "=" is a bright idea?
Do you have any ideas?
Any help is appreciated.
Link to comment
Share on other sites
10 answers to this question
Recommended Posts