Hi All,
I've been working on this project for quite a while, and have asked questions and got solutions too. But in an addition to the very same project, I have another tiny bit to try, but not sure if that is possible.
In this program, I read a file, scan the values process the values and output the result. Again, these files do not necessarily have the have the same format. So to check for different file formats, I scan file and check the number of values: But all the files have a set of required values, apart from some extra ones.
File Format1 : "$PID, 23.4, 34.4, 44 "
vector<CGeoData> DataTable; CGeoData DataLine;
if (swscanf_s(buffer, _T("%[^,],%lf,%lf,%lf"),string1, double1, double2, double3) == 4)
{
}
else if (
else if (
else (
Now that done, this works for the formats given so far. But in future if at all there is a completely different format, I don't want that to go into error, but want to save that as a new format.
That is, check if a file matches with a format, if not instead of sending that as an error, check if it contains the variables, if yes, save that as a new format.
Been thinking about this for a while now, but couldn't come up with a solution.Can this be possible?