Jump to content

Is there a way to change records in a Datalog file


Recommended Posts

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.