11-02-2009 06:18 PM
Allright, I finally had a chance to return to this issue, and I'm so very close. I didn't change much to your existing code, it's very clever, thank you. I added the filter that finds the 0x01 to determine header length (works great), and then I added some code to save the newly created arrays as binary files. But what I added doesn't work, and I'm confident that I'm not saving the files correctly.
Originally, I had the Open/Write/Close Binary file outside the loop with the built array and the loop index number wired to that Open/Write/Close sequence so that the original file name would be used with simply an _00, _01, _02, _03 sequence after the filename, but that didn't work. I then put the sequence inside the loop, and still it doesn't work. What am I doing wrong?
To put this issue to rest, all I need to do after this is concatenate the ASCII header file to the beginning of each subfile created. Is it possible to do this with two differenet data types (ASCII, U8)? Must I translate one of them into the other format and then concatenate and then save?
Thanks,
~Tristan
11-03-2009 09:03 AM
You're not setting the file position to the correct location after reading the 1024 bytes. As I noted, you have to set the file pointer to the position where the data actually begins, and prior to entering the loop, since the actual end of the header is somewhere within that first 1024 bytes. As it is right now, the loop starts reading at the 1025th byte, which is probably in the middle of a record.
11-03-2009 12:18 PM
Maybe I don't understand what you mean by "file pointer" because I attempted to do what you suggested. I am not getting results, which suggests you are right, but I am confused as how to proceed.
I can see how what I am doing is not setting the file pointer to the end of the header, it is simply defining the size of the binary data by subtracting the length of the header from the calculations of file length. But I still don't see how it's hard wired to begin reading data at 1025 bytes.
It is not apparent in the Help topics how to set the file pointer, will you shed some light on this for me please?
11-03-2009 12:41 PM
It's not that difficult: Set File Position.
See attached mod. Check to make sure the position is being set to be right after the 0x01 byte that indicates the end of the header.