Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more: , +
this txt file contains hex values i want to change this into dec and divided into li l2 t1 t2 v1 v2 p h
these are hex values
4f337d5000000001
4f337d5000000001
0082004600010000
0082004600010000
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100


What I have tried:

suggest me any method or code which can help me
Posted
Updated 25-Aug-17 12:18pm
v3
Comments
Richard MacCutchan 24-Aug-17 10:49am    
The first thing you need to do is decide which of the languages you have tagged is the one you plan to code in.

For example by

  • Reading the text file line by line
  • Converting each line to a 64-bit integer and store that in an array
  • Writing 8 values from the array to a text file separating them with a comma
Depending on the language this might require to determine the array size in advance by counting the number of lines in the file.

You have tagged your question with multiple programming languages. I suggest to use the one with which you are most familiar. The tasks from the above list are basic programming tasks. Only the hex string to 64-bit integer might require some work if not supported by the language (with C/C++ just use strtoull - C++ Reference[^]).
 
Share this answer
 
Sounds like you need to learn some basics for your job. At first you need to read the file. How it can be done is explained in Input/output with files tutorial.

After that you must split the string in parts as discussed in this answer of stackoverflow. I like the last sample code most.

Than use the stroul function to parse the hex-string into a number and you are on the final output step, which should be a piece of cake.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900