LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

reading 0X01A3 format values from a file,

Hi,
I have a file with format

0x000F 31223
....


basically a C notation Hex and then an integer. The files are created apparantly by a programme written in LabVIEW.

is there any easy way to access these without reading them chartacter by character using fgetc and then trying to make sense of them . Needless to say that is really the last thing I'd like to do.
0 Kudos
Message 1 of 2
(2,770 Views)
You can use the ANSI C fscanf() function to read the data in the format 0x000F 31223

FILE *myfile;
int iHex, iDec;
myfile = fopen ("mydata.txt", "r");
fscanf (myfile, "0x%x %d", &iHex, &iDec);
0 Kudos
Message 2 of 2
(2,766 Views)