How to extract specified data from a JSL hexadecimal file to a decimal file?"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.

ScriptingRe: How to extract specified data from a JSL hexadecimal file to a decimal file?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

Re: How to extract specified data from a JSL hexadecimal file to a decimal file?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"

Re: How to extract specified data from a JSL hexadecimal file to a decimal file?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!
Re: How to extract specified data from a JSL hexadecimal file to a decimal file?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" );

Re: How to extract specified data from a JSL hexadecimal file to a decimal file?@lwx228 when I'm trying to extract information from a binary file without proper documentation, I have to think about what might happen next: the file format might change; I might not be around to support my hack; I might not actually understand the format. If the vendor that creates the file supplies tools for manipulating the file, you should use them. If the vendor documents the file format, you should use that documentation.

Re: How to extract specified data from a JSL hexadecimal file to a decimal file?Thanks for Craige's rigorous attitude.
My DAT data is free software data, in the window interface operation of the software can directly export TXT format data,
such as these two codes "113027" 、"123029"s data is derived in the software.
I just want to know how to make JMP directly read the data in the DAT file in this software,
so that there is no need to manually export the data in the software interface to save the TXT file to the hard disk, and then dual-use JMP to import the TXT file to the hard disk.
Thanks to the experts for their help.
Re: How to extract specified data from a JSL hexadecimal file to a decimal file?Do you know if the software has command line options for doing that task? I've seen some programs have CLI versions of some of their functions.
If you're lucky you might be able to do something like
Names default to here(1);
RP = Run Program(
Executable( "DatFileCreator.exe" ),
Options( { // all of these options are made up but I've seen programs have them before.
"-export 1"
, "-filepath 'C:\Fake\somefile.dat'"
, "-exportpath 'C:\Fake\sometxtfile.txt"
} ),
ReadFunction( Function( {this}, Write( this << read ) ) )
);
dt = open("C:\Fake\sometxtfile.txt");
I would look through their command line arguments first. Plus if they update their file format, they **should** update their export functionality and you won't have to rewrite it.
Re: How to extract specified data from a JSL hexadecimal file to a decimal file?Thank you very much!
I didn't find
"DatFileCreator.exe"
file in my search.
I used to use similar software, but now the DAT data has changed and the software is no longer available.

Re: How to extract specified data from a JSL hexadecimal file to a decimal file?That's not a real software. I meant whatever software is outputting this data file.