Binary read (Language Help)

by Jim ⌂ @, Russell, KY, Monday, August 20, 2012, 02:46 (1714 days ago) @ zahurdias

No native way but this will work.

Jim


file$ = "hexdump.kbs" # replace with your file name
temp$ = "tempfile.txt" # temporary file name

# this statement converts binary file to a hex dump of one byte
# per line
# used LINUX command line hex dump program
# if Windows you will need to find a hex dump program
# and change the command accordingly
system "xxd -p -c 1 " + file$ + " > " + temp$

open temp$
while not eof
#read 2 digit hex number (one byte)
hex$ = read()
print hex$;
end while
close

#delete temporary file
kill temp$


Complete thread:

 RSS Feed of thread

powered by my little forum