"Min1.dat" is a hexadecimal file.I have saved the data of the two tables in this DAT file.For example, the original data of the file encoded as "113027" looks like this.
Your file might have Little Endian numbers. But without documentation of the file format, you can't be sure there is not another bit in the file that chooses Big vs Little representation. There can be a lot of bits that determine the shape of the binary data, and they can change if the program that generates the data runs with different options/data/environment.
Fun fact about Little Endian numbers: the 6502 processor in the ancient Apple II computer used Little Endian because it was faster to add two 2-byte numbers. The add of the low-order byte could be done in parallel with fetching the high-order byte that followed. The carry could then be propagated to the high order byte.
Open "min1.dat" with "HxD x64.Exe to see the specific hexadecimal symbol.
JSL scripts written with Craige can also see this and display the same content.
b = Load Text File( "D:\0\Min1.dat", blob() ); // load your file hex = Hex( b );
I have found the hexadecimal symbol shown in the first line of the file "113027" in HxD.exe.The hexadecimal number for data 2010090931 is "B38DCF77" and the hexadecimal number for data 2010090932 is "B48DCF77"
How can use JSL to efficiently locate data, restore floating point data, and extract only the specified data?How to extract all the data encoded "113027" directly from a hexadecimal file using JSL?
Thanks Experts!
I used "Contains" to determine the location of the time data, but found it inefficient.
b = Load Text File( "D:\0\Min1.dat", blob() ); // load your file hex = Hex( b ); last4hex = Right( hex, 8 ); num = Length( b ); last4blob = Blob Peek( b, Length( b ) - 4, 4 ); da1 = "B38DCF77";//B3~8D~CF~77 da2 = "B48DCF77"; off1 = Contains( hex, da1 ); off2 = Contains( hex, da2, -1 ); If( off1, hex = Substr( hex, off1, Length( hex ) ) ); If( off2, hex = Substr( hex, 1, off2 + 1 ) ); mat = Blob To Matrix( b, "int", 4, "big" );