06-08-2011
@getmmg,
Thanks for the help. It worked.
@itkamaraj,
Thanks for your pointers! They helped me to write my own code in unix shell script.
@alister,
Thank you!
---------- Post updated at 12:20 PM ---------- Previous update was at 12:15 PM ----------
My query is resolved and this thread can be closed!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello !
Does anyone knows how can I convert hexadecimal to decimal base in the ksh or csh script ??
Thanks !
Witt (1 Reply)
Discussion started by: witt
1 Replies
2. Shell Programming and Scripting
Hi frnds :)
I need a small help...
I have a very long file containing 20 digits decimal number which i want to convert into the corresponding 16 digit hexadecimal values.
File looks like....
11908486672755551741
05446378739602232559
04862605079740156652
.
.
.
I tried the script
for i... (7 Replies)
Discussion started by: vanand420
7 Replies
3. Shell Programming and Scripting
hi ,
i need a script to convert number into hexadecimal base
for example: 237=>ED
it s very important for me thank you in advance for you help (5 Replies)
Discussion started by: mips
5 Replies
4. UNIX for Dummies Questions & Answers
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)
Discussion started by: Arunprasad
2 Replies
5. Shell Programming and Scripting
Is there any way to convert numeric values txt file to PACKED DECIMAL File using PERL.
Regards,
Alok (1 Reply)
Discussion started by: aloktiwary
1 Replies
6. Shell Programming and Scripting
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)
Discussion started by: PCGameGuy
10 Replies
7. Shell Programming and Scripting
The file contains code like the below and need to convert each one into a decimal
00 00 00 04 17 03 06 01
So the output should come as
0 0 0 4 23 3 6 1 (24 Replies)
Discussion started by: necro98
24 Replies
8. Shell Programming and Scripting
hi all,
this is my script:
#! /bin/sh
minutes=$( { i2cget -f -y 0 0x51 3; } 2>&1 )
minutes=${minutes:2}
hour=$( { i2cget -f -y 0 0x51 4; } 2>&1 )
hour=${hour:2}
day=$( { i2cget -f -y 0 0x51 5; } 2>&1 )
day=${day:2}
month=$( { i2cget -f -y 0 0x51 7; } 2>&1 )
month=${month:2}
... (6 Replies)
Discussion started by: enaud
6 Replies
9. Programming
Hi ,
seq can be 0...128
int windex = seq / 8;
int bindex = seq % 8;
unsigned char bitvalue = '\x01' << (7-bindex) ;
bpv.bitmapvalue = bitvalue;
This is the part of a program to convert decimal to bitmap value of hexadecimal.
I want this to change to convert only to... (1 Reply)
Discussion started by: greenworld123
1 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
cat filename | awk '{print $1, $2, $4, $5, $6, $7, $8, $9, $10;}' | awk 'NF > 0'
OUTPUT:
2015-01-19 00:12:32 00000000fbfa0000 000000009ae5cf80 014d 015d 0017 003c 0362de20
2015-01-19 00:13:52 00000000fc820000 00000000994c6758 014c 015d 000b 003c 08670250
2015-01-19 00:14:25... (12 Replies)
Discussion started by: sam@sam
12 Replies
DECHEX(3) 1 DECHEX(3)
dechex - Decimal to hexadecimal
SYNOPSIS
string dechex (int $number)
DESCRIPTION
Returns a string containing a hexadecimal representation of the given unsigned $number argument.
The largest number that can be converted is PHP_INT_MAX
* 2 + 1 (or -1): on 32-bit platforms, this will be 4294967295 in decimal, which results in dechex(3) returning ffffffff.
PARAMETERS
o $number
- The decimal value to convert. As PHP's integer type is signed, but dechex(3) deals with unsigned integers, negative integers
will be treated as though they were unsigned.
RETURN VALUES
Hexadecimal string representation of $number.
EXAMPLES
Example #1
dechex(3) example
<?php
echo dechex(10) . "
";
echo dechex(47);
?>
The above example will output:
a
2f
Example #2
dechex(3) example with large integers
<?php
// The output below assumes a 32-bit platform.
// Note that the output is the same for all values.
echo dechex(-1)."
";
echo dechex(PHP_INT_MAX * 2 + 1)."
";
echo dechex(pow(2, 32) - 1)."
";
?>
The above example will output:
ffffffff
ffffffff
ffffffff
SEE ALSO
hexdec(3), decbin(3), decoct(3), base_convert(3).
PHP Documentation Group DECHEX(3)