473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Converting a HEXADECIMAL file into a DECIMAL file

Hi all!!

How do you convert a HEXADECIMAL file into a DECIMAL file?

Contents of the Input file:
1) Hexadecimals
2) File has got 1000 entries
3) There are 10 fields of variable length, separated with "^"


Contents of Output file:
1) Decimals
2) When using WordPad to open the file, it will appear organised.
3) Some fields will require 2's complement.

Any takers? Thanks a lot for your advice... =)
Apr 5 '07 #1
1 1978
gpraghuram
1,275 Expert 1GB
HI,
the pseudocode would be
1)Read the file line by line
2)After reading a line,
2.1)Tokenize it using ^
2.2)take every token, use the strtol() function to convert it to decimel
2.3)Print it to out file

Thanks
Raghuram
Apr 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sverre Bakke | last post by:
Hi I am using the base_convert() function to convert numbers between binary, hexadecimal, decimal, etc... It works great, but I have problems converting numbers with .'s Like this number: ...
25
by: TK | last post by:
I'm used to programming in c or c++ in which my problem is simple. I want to be able to enter a value on a page (like 3.2), and then read it as a 32-bit float and break it into it's individual...
15
by: jaks.maths | last post by:
How to convert negative integer to hexadecimal or octal number? Ex: -568 What is the equivalent hexadecimal and octal number??
5
by: Jeff Dillon | last post by:
How might I convert a string like 10.A (in hex) to it's decimal equivalent? Basically I have an input string like ((1F.A + 3A.D) - 1F.E) and need to calculate the result. Using Reflection and...
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
5
by: ria3 | last post by:
Hi, I have to write a program that will alow the user to specify a number (decimal, binary, or hexadecimal) and a base to convert to (decimal, binary, or hexadecimal) using subroutine methods and...
7
by: Gonzchris | last post by:
What would be the easiest way of going about converting a 3 digit hexadecimal number to decimal, I think that a switch statement is out of the question due to multiple digits. Would it be easiest...
4
by: Cdude | last post by:
I am receiving data from a machine though a Ethernet port.But when C# pulls the data in it reads the data as decimal not hexadecimal.How can i pull the data as a hex and not as a decimal?please any...
0
by: Terry Reedy | last post by:
A. Joseph wrote: These are number representation systems that can be applied to or used with integral, rational (numberator,denominator), and 'point' numbers. Try Wikipedia or any search...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.