LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read binary files one chr at a time

I need to read a binary file that has an ASCII header and then 16 bit signed integer values. I would like to read it one character at a time so that I can process information in the header and then switch to process the 16 bit integer information.

I have written a few test .vis and I can read the information, were I’m having trouble is in sampling the individual characters as I read them or getting them into an array so  I can process after I close the source file. Anybody got an idea?

0 Kudos
Message 1 of 2
(2,629 Views)
Unless your file is really small, reading one character at a time is going to be very expensive in terms of time. Do you know how long the header is? If so, simply read that many characters to get the header, and then read the rest of the file as an array of 16-bit integers. E.g.:
0 Kudos
Message 2 of 2
(2,615 Views)