Hello friends,
How can I unpack a 4byte binary file, store like the following example, to array or TEXT file ?
input file:
00000000 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 |................|
00000001 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 01 |................|
desired output file:
0,1,1,0,1,1,1,1
For now I'm using the following unpack code:
open(ERROR_ID_BIN, "<", "/error_id.bin") or die $!;
local $/;
my @err_values = unpack("V*", <ERROR_ID_BIN>);
close(ERROR_ID_BIN);
print "\n\n\n\n\t@err_values\n\n\n";
And my problem is that it flips the values and gives me that:
0,16777216,16777216,0,16777216,16777216,16777216,16777216
What should I do ?