"rsk" <kr******@yahoo.co.inwrites:
My requirement is as follows;
A file is consisting of data in hexadecimal format(i.e a 32 bit data for
example like "0xdeadbeef").
[snip]
Let's be sure we really understand your data format, since I've seen a
lot of confusion on this point.
Does the file actually contain data represented in hexadecimal? In
other words, for the value 3735928559 (0xdeadbeef), does the file
actually contain the (probably ASCII) characters 'd', 'e', 'a', 'd',
'b', 'e', 'e', 'f'? (And if so, are they preceded by the characters
'0', 'x'?) Or are 32-bit numbers stored in the file in a 32-bit
binary format?
We've seen people here refer to raw binary as "hexadecimal", probably
because that's how binary files are often *viewed*. But in fact,
binary ahd hexadecimal are very different formats.
If the values are stored in hex, how are the values separated? Does
each hexadecimal literal occur on a line by itself (terminated with
'\n')? Or are there multiple literals per line, and are they
separated by spaces, tabs, commas, arbitrary whitespace, or something
else?
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"