Oct-09-2020, 12:43 AM
(This post was last modified: Oct-09-2020, 12:43 AM by medatib531.)
Hello,
I have a file that has several hex string values, separated by the newline character. E.g. the file looks like:
I can easily parse this file and find e.g. the 10th string based on the line number.
However I want to convert the file to binary to save disk space.
I was thinking of using
however I'm not sure what's the best way to handle their ordering, i.e. just concatenate the byte arrays? Note that the original file can be huge, maybe several gigabytes in size, and I'm not sure how efficient it would be to parse the billion-th value.
I have a file that has several hex string values, separated by the newline character. E.g. the file looks like:
1 2 3 4 |
dd5bda81 ae0ac495 b97a7664 ... |
However I want to convert the file to binary to save disk space.
I was thinking of using
1 |
binascii.unhexlify() |