Convert a list of decimal values in a text file into hex format
4
votes
7
answers
8664
views
I have a need to convert a list of decimal values in a text file into hex format, so for example test.txt might contain:
131072
196608
262144
327680
393216
...
the output should be list of hex values (hex 8 digit, with leading zeroes):
00020000
00030000
00040000
...
the output is printed into the text file. How to make this with python or linux shell script?
### EDIT #1
I missed one extra operation: I need to add
80000000
hex to each of the created hex values. (arithmetic addition, to apply to already created list of hex values).
Asked by minto
(575 rep)
Jul 21, 2018, 01:29 PM
Last activity: Apr 23, 2024, 03:24 PM
Last activity: Apr 23, 2024, 03:24 PM