Hi tmaxial.
You could try using the Scan() function to parse each line of the file:
#define MAX_LINE_LENGTH 80
int myData[500]; // change to double[] if you need to (also change the Scan() call)
int i=0, iTemp, hour, minute, dataItems;
char lineBuffer[MAX_LINE_LENGTH];
handle = OpenFile (myfile, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
bytesRead = ReadLine (handle, lineBuffer, MAX_LINE_LENGTH - 1);
while ((bytesRead >= 0) && (i < 500)) // not end of file or error
{
// Skip blank lines
if (!bytesRead)
continue;
items = Scan (lineBuffer, "%i %s[w6] %i:%i", &iTemp, dummy, &hour, &minute);
if (items < 0)
break;
if (items > 0)
{
myData[i++] = iTemp;
// Store string & other data if required...
}
bytesRead = ReadLine (handle, lineBuffer, MAX_LINE_LENGTH - 1);
}
dataItems = i;
Regards,
Colin.