Need 32Bit Floating Data Converted Into .csv


Recommended Posts

You can use a combination of the File.Open / File.ReadInter, File.Close function to read the file, To.Float to convert the binary to actual numbers, then file.writeDelim to write it back as a csv file.  Assuming you had 32 bit float binary format selected and your time precision was low enough that you only had two columns for time and 13 columns of data, it would be something like this:


private string path = "c:\data\mybinaryFile.bin"
private handle = file.Open(path, 1, 0,0,0)
global out
private t1 = to.Float(file.ReadInter(handle,0, 4*15, 4, 0))
private t2 = to.Float(file.ReadInter(handle,4, 4*15, 4, 0))
out[][0] = t1 + t2
for (private i = 2, i < 15, i++)
   t1 = to.Float(file.ReadInter(handle,i*4, 4*15, 4, 0))
   out[][i-1] = t1

handle = file.Open(path + "_OUT.csv", 0, 1, 0, 1)
file.WriteDelim(handle, out, ",", chr(10))
Link to comment
Share on other sites


This topic is now archived and is closed to further replies.