Hello!
For example this file with this script can get the first data is a date.
How do I use a script to extract this "A2 3F 32 01"and use a script to calculate its corresponding decimal value= 20070306
Thanks!
This will not reverse success
bb = Load Text File( "I:\E\00820070306.zst", blob() ); ymd = Blob To Matrix( bb, "uint", 4, "little", 8 ); a=Munger(char(bb),contains(char(bb),"(")+4,12); b=Char To blob(a, "utf-8" );; mat=blobtomatrix(b, "uint", 4, "little", 8 );
Maybe BLOB Peek(blob, offset, length) would work? Also this might be a good watch Importing Binary Data with JSL (2022-EU-45MP-946)
Your code
bb = Load Text File( "I:\E\00820070306.zst", blob() ); ymd = Blob To Matrix( bb, "uint", 4, "little", 8 );
is creating a 2 dimensional matrix you are calling "ymd" with the values converted to decimal values. All you have to do, is to create a new data table, then create a new column and set the values in the new column to the first column in the matrix ymd.
Names Default To Here( 1 ); bb = Load Text File( "I:\E\00820070306.zst", blob() ); ymd = Blob To Matrix( bb, "uint", 4, "little", 8 ); dt = New Table( "zst" ); dt << New Column( "col 1" ); Column( dt, 1 ) << set values( ymd[0, 1] );
Then just repeat it for the remaining 7 columns in the matrix
Thank Jim!
Yes, I got this code from Craige.
This code is useful when it knows the binary data structure.
But this new file I don't know its data structure.I'm on a quest.
I'm wrapping this file at 00 intervals.I get the data for this.
Except for the first line which I know contains the date.
But the data starting in the second line is integer data, floating point data.But which field is a floating point, or an integer.I don't know.
I can only restore the comparison field by field.
I still haven't figured it out yet.
Best of luck