hfettig Posted January 27, 2009 Report Share Posted January 27, 2009 Here is what I want to do: I have 240 records (cluster of data), which I want to randomly access and modify. The accessing part is easy but every time I try to change one of the records a new record is added to the end of the file. I do set the file position before calling the write function, but I just noticed in the help for the write function that it says that the file pointer is always set to the end of the file before writing. Is there a way to avoid that or will I have to go with my own custom binary format? Cheers, Heiko Quote Link to comment
jdunham Posted January 27, 2009 Report Share Posted January 27, 2009 QUOTE (hfettig @ Jan 26 2009, 08:41 AM) I have 240 records (cluster of data), which I want to randomly access and modify.The accessing part is easy but every time I try to change one of the records a new record is added to the end of the file. I do set the file position before calling the write function, but I just noticed in the help for the write function that it says that the file pointer is always set to the end of the file before writing. Is there a way to avoid that or will I have to go with my own custom binary format? I think the datalog format is just a cluster of two elements: a DBL timestamp (old-fashioned) and a cluster of all the front panel data in tab order. I don't know if there's also a header at the beginning of the file. It shouldn't be too hard to read all the records, modify the one you want, and write everything back to a new file. That being said, the datalog format is a terrible format, and I really wish they would revamp that system, since the datalog feature is really great. You might be better off with your own format or TDMS format. Quote Link to comment
hfettig Posted February 3, 2009 Author Report Share Posted February 3, 2009 Thanks, I went with a custom binary format. Works well now. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.