Hello everybody,
as a regular user of 010 editor and author of some binary templates (two in the repo, a third following) i had an idea for a feature which i want to discuss.
It would be a great help if one could export the data structure from a binary template.
I am working on a Retrodrive template. It can parse old floppy images (like CP/M or FLEX and FDOS for now). I was thinking it would be nice if one could highlight a file for example and then export the user data to a file. It would make a some tools unnecessary. The “Save Selection” Menu is already there. A Multi Selection of Datablocks in the Template Results Window would need to be there, and then a Contextmenu which calls a “special” function in the script with the selected datapointer.
Or something like that.
Please tell me what you think.
Hello Robert. Are you just looking to write various blocks of data from a data file to a separate file? If the blocks are all contiguous then you might be able to use the ‘Selection > Mark Selection Start’ and ‘Selection > Mark Selection End’ functions on the right-click menu, and then ‘Save Selection’. If the blocks are not contiguous then you would probably have to use a script to save the blocks and we could give some examples on how to do this. We are planning on adding multi-select in the Template results but that is not available right now. Let us know if you need any more information.
Thank you for your reply.
Unfortunately the blocks are non-continuous. I would like an example of a script which could do that. I don’t have experience with scripts, but it looks like a promising solution. Is there a connection with the binary template or does the script run completely independent?
Can i at least run a script from the template to have access to the variables? It would be twice the work if this wouldn’t be possible.
In this example, record[0] and dirEntry[1] are the variables that are exported. The script can automatically access these variables as long as the template is run on the file first. You also have to make sure that you are running the script on the data file and let us know if you have any trouble getting this to work.