Click here to Skip to main content
14,428,471 members
Rate this:
Please Sign up or sign in to vote.
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 13: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.
Rate this:
Please Sign up or sign in to vote.

Solution 3

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[^]).
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100