I need to have my scripts import volume groups and mknod devices files. I have most of the script working but the device file needs to be in the format 0x??0000 (where the question marks are my HEX representations of the volume group number. I have the code below and the output it produces which... (2 Replies)
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)
Please Help Me! about the problem down under.
I have 2 files with nearly the same characteristics, I have to convert one to the other format or the other format to one's format. I want to write it with awk.
The first file contain lines like this:
300000001#A#Y#Y#Y#Y
The other file contain... (4 Replies)
Alo
I have this input:
0x10=some text
0x20=some text
0x30=some text
and want this output:
16=some text
32=some text
48=some text
I want to use a command to convert from hex to decimal i.e.:
$ echo $((0x15a))
or
$ printf '%d\n' 0x15a
I try to use something like this:
sed... (5 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)
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)
Discussion started by: before4
1 Replies
LEARN ABOUT PLAN9
xd
XD(1) General Commands Manual XD(1)NAME
xd - hex, octal, decimal, or ASCII dump
SYNOPSIS
xd [ option ... ] [ -format ... ] [ file ... ]
DESCRIPTION
Xd concatenates and dumps the files (standard input by default) in one or more formats. Groups of 16 bytes are printed in each of the
named formats, one format per line. Each line of output is prefixed by its address (byte offset) in the input file. The first line of
output for each group is zero-padded; subsequent are blank-padded.
Formats other than -c are specified by pairs of characters telling size and style, by default. The sizes are
1 or b 1-byte units.
2 or w 2-byte big-endian units.
4 or l 4-byte big-endian units.
8 or v 8-byte big-endian units.
The styles are
o
Octal.
x
Hexadecimal.
d
Decimal.
Other options are
-c Format as 1x but print ASCII representations or C escape sequences where possible.
-astyle Print file addresses in the given style (and size 4).
-u (Unbuffered) Flush the output buffer after each 16-byte sequence.
-s Reverse (swab) the order of bytes in each group of 4 before printing.
-r Print repeating groups of identical 16-byte sequences as the first group followed by an asterisk.
SOURCE
/sys/src/cmd/xd.c
SEE ALSO db(1)BUGS
The various output formats don't line up properly in the output of xd.
XD(1)