Hi all,
I have a small script to convert my HexaDecimal Input to Decimal as output.
#!/bin/ksh
hd=00208060
dec=`printf %d $hd`
echo $dec
Output of the above program:
printf: 00208060 not completely converted
16
But my expected output is "2130016".
How can i acheive this.
I... (2 Replies)
Hi,
Can anyone please help me ascci to decimal conversion in bash
I have a file which contains stream of numbers like this,these are ascci values
729711810132973278105991013268971213233
I want to covert it to its actual value like upper code's decimal is
"Have a Nice Day!"
... (15 Replies)
Dear All PROs
Thanks in advance
need a shell for Decimal to hex conversion
input file (decimal values)
65,5,48,66,133,131,118,47
65,5,48,66,133,131,83,63
.
.
desire output should be (Hex value)... (11 Replies)
I have a text file of alphanumeric values listed one by one. I have to convert them to hexadecimal equivalents for each character seperated by ":" in Unix bash shell script. For example, 12345678 has to be converted to 31:32:33:34:35:36:37:38 (10 Replies)
I have searched and the answers I have found thus far have led me to this point, so I feel I am just about there.
I am trying to convert a column of hexadecimal to decimal values so that I can filter out via grep just the data I want. I was able to pull my original 3 character hex value and... (10 Replies)
Hi Guys,
Is it possible to convert the hexadecimal to Binary by unix command.....I could not figure out....
If I need to convert AF6D to binary...what could be the way to do?
Thanks in advance!!
---------- Post updated at 02:57 AM ---------- Previous update was at 02:42 AM ----------
I... (6 Replies)
How can I convert hexadecimal values to Binary from the second field to the end
Input:
WS-2 23 345 235
DT-3 45 4A3 000
pp-2 76 300 E4
Output:
WS-2 100011 1101000101 1000110101
DT-3 1000101 10010100011 000
pp-2 1110110 1100000000 11100100 (16 Replies)
STRTOD(3) Library functions STRTOD(3)NAME
strtod, strtof, strtold - convert ASCII string to floating point number
SYNOPSIS
#include <stdlib.h>
double strtod(const char *nptr, char **endptr);
float strtof(const char *nptr, char **endptr);
long double strtold(const char *nptr, char **endptr);
DESCRIPTION
The strtod, strtof, and strtold functions convert the initial portion of the string pointed to by nptr to double, float, and long double
representation, respectively.
The expected form of the (initial portion of the) string is optional leading white space as recognized by isspace(3), an optional plus
(``+'') or minus sign (``-'') and then either (i) a decimal number, or (ii) a hexadecimal number, or (iii) an infinity, or (iv) a NAN (not-
a-number).
A decimal number consists of a nonempty sequence of decimal digits possibly containing a radix character (decimal point, locale dependent,
usually ``.''), optionally followed by a decimal exponent. A decimal exponent consists of an ``E'' or ``e'', followed by an optional plus
or minus sign, followed by a non-empty sequence of decimal digits, and indicates multiplication by a power of 10.
A hexadecimal number consists of a ``0x'' or ``0X'' followed by a nonempty sequence of hexadecimal digits possibly containing a radix char-
acter, optionally followed by a binary exponent. A binary exponent consists of a ``P'' or ``p'', followed by an optional plus or minus
sign, followed by a non-empty sequence of decimal digits, and indicates multiplication by a power of 2. At least one of radix character
and binary exponent must be present.
An infinity is either ``INF'' or ``INFINITY'', disregarding case.
A NAN is ``NAN'' (disregarding case) optionally followed by `(', a sequence of characters, followed by ')'. The character string specifies
in an implementation-dependent way the type of NAN.
RETURN VALUE
These functions return the converted value, if any.
If endptr is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by
endptr.
If no conversion is performed, zero is returned and the value of nptr is stored in the location referenced by endptr.
If the correct value would cause overflow, plus or minus HUGE_VAL (HUGE_VALF, HUGE_VALL) is returned (according to the sign of the value),
and ERANGE is stored in errno. If the correct value would cause underflow, zero is returned and ERANGE is stored in errno.
ERRORS
ERANGE Overflow or underflow occurred.
CONFORMING TO
ANSI C describes strtod, C99 describes the other two functions.
SEE ALSO atof(3), atoi(3), atol(3), strtol(3), strtoul(3)Linux 2001-06-07 STRTOD(3)