Hi,
please tell me how to convert hex number to decimal
000000E7
000000000002640D
0000000000025B16
and seconds to minutes, hours, days, months, years
bytes to kbytes, mbytes , gbytes
read the following examples
while read a b
do
printf "%5d %5d\n" "0x$a" "0x$b"
done < "$FILE"... (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 am writing a bash script to do some parsing on a log and I am running into a problem when it comes to converting only certain sections of the file from hex to ascii or hex to decimal.
Data Example:
The hex values after Hardware and SW Version I need to convert from Hex to ASCII and the... (16 Replies)
I have 32 bit value in hex that I want to separate into fields and then convert the fields into decimal values.
Input file has 2 words of 32 bit hex values:
000001ac
ca85210e
Output both words separated into individual bit fields:
ca85210e: f1(31:9), f2(8:0)
f7c392ac: f1(31:14),... (2 Replies)
can someone help me in converting hex streams to decimal values using perl script
Hex value:
$my_hex_stream="0c07ac14001676";
Every hex value in the above stream should be converted in to decimal and separated by comma.
The output should be: 12,07,172,20,00,22,118 (2 Replies)
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)
How to convert decimal value to hex and than take 1st digits as variable
sample data
84844294,5,6
51291736,2,3
84844294,5,6
51291736,2,3
i can use {printf "%x,%d\n",$1,$2} but than i want to filter base on 1st hex digit 1st recrd (1 Reply)
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
LEARN ABOUT PHP
current
CURRENT(3) 1 CURRENT(3)current - Return the current element in an arraySYNOPSIS
mixed current (array &$array)
DESCRIPTION
Every array has an internal pointer to its "current" element, which is initialized to the first element inserted into the array.
PARAMETERS
o $array
- The array.
RETURN VALUES
The current(3) function simply returns the value of the array element that's currently being pointed to by the internal pointer. It does
not move the pointer in any way. If the internal pointer points beyond the end of the elements list or the array is empty, current(3)
returns FALSE.
Warning
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on
Booleans for more information. Use the === operator for testing the return value of this function.
EXAMPLES
Example #1
Example use of current(3) and friends
<?php
$transport = array('foot', 'bike', 'car', 'plane');
$mode = current($transport); // $mode = 'foot';
$mode = next($transport); // $mode = 'bike';
$mode = current($transport); // $mode = 'bike';
$mode = prev($transport); // $mode = 'foot';
$mode = end($transport); // $mode = 'plane';
$mode = current($transport); // $mode = 'plane';
$arr = array();
var_dump(current($arr)); // bool(false)
$arr = array(array());
var_dump(current($arr)); // array(0) { }
?>
NOTES
Note
You won't be able to distinguish the end of an array from a boolean FALSE element. To properly traverse an array which may contain
FALSE elements, see the each(3) function.
SEE ALSO end(3), key(3), each(3), prev(3), reset(3), next(3).
PHP Documentation Group CURRENT(3)