Sponsored Content
Top Forums UNIX for Advanced & Expert Users Req on how to convert hex numbers to decimals Post 302177530 by Franklin52 on Friday 21st of March 2008 11:04:05 AM
Old 03-21-2008
Or with printf:

Code:
printf "%d\n" "0x00046b3"

Regards

Edit: Jim was faster!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing two numbers with the decimals

Can someone tell me how do I comapre two numbers with the decimals in UNIX shell scripting I understand "-gt" can be used only for integers Regards, Giri (4 Replies)
Discussion started by: chittari
4 Replies

2. Shell Programming and Scripting

ksh and hex numbers

typeset -i A=16#0 typeset -u A=$a y=${A#16#} This converted $a to hex and stored it in y. Can someone walk me through how this was done? thanks (2 Replies)
Discussion started by: JamesByars
2 Replies

3. Shell Programming and Scripting

How to Convert Hex value to Dec ?

Hi All, I want to convert below Hex value to Dec value in each column .How to do it ? This data is in a 1 file. 4e20 0475 2710 010f 7530 69a2 7530 7e2f 4e20 02dd 7530 6299 4e20 0c0a 7530 69a2 4e20 0a0b 2710 0048 7530 7955 4e20 0d23 7530 622d 7530 9121 2710 001f 7530 7d3f (6 Replies)
Discussion started by: Nayanajith
6 Replies

4. Shell Programming and Scripting

convert Regular decimals to Packed decimals

Hi, I am trying to find if there is a way to convert regular decimal values to Paced decimal values. I tried to find a c program but I could get a Packed converted to regular decimal not the other way round. If not unix please let me know if any other progrimming language I can use to do... (2 Replies)
Discussion started by: mgirinath
2 Replies

5. Programming

Convert HEX to EBCDIC IN C

i want to convert Hex value To EBCDIC value. i tried to convert hex to ascii and then to ebcdic but it doesn't give desired results . it doesn't give corresponding ebcdic value instead it gives some junk values. e.g; Hex EBCDIC ----------------- 81 a 82 b 83 c 84 d 85 e 86 f 87... (6 Replies)
Discussion started by: junaid.nehvi
6 Replies

6. Shell Programming and Scripting

How to convert hex numbers to decimal ?

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)
Discussion started by: jack2
15 Replies

7. Shell Programming and Scripting

Convert Hex - KSH

Hello, I woild like to convert hex on KSH not BASH: I tried to use: tmp=31 printf "\x"${tmp}"" it works on bash - Output is '1' but not on ksh. please advice on the right syntax. Thanks. (4 Replies)
Discussion started by: LiorAmitai
4 Replies

8. Shell Programming and Scripting

Convert to Hex in perl

Hi, i want to convert number 5860533159 to hexadecimal. i need to use perl. i used $foo = 5860533159; $hexval3 = sprintf("%#x", $foo); i am getting value as 0xffffffff. i need to get value as 0x15D50A3A7. when i converted using google calculator, i got the correct value, expected... (9 Replies)
Discussion started by: asak
9 Replies

9. Shell Programming and Scripting

Convert hex to decimal

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)
Discussion started by: Arun_Linux
2 Replies

10. Shell Programming and Scripting

Assign numbers with decimals from a line to a variable

I am trying to assign a string of numbers with their decimals to a variable. The code reads a file called 'log'. I have not included the entire file since it's huge. The line is: Tagging release with the label program-2.8.114...My code: BUILDNUMFORSIT=$(egrep 'Tagging release with the... (3 Replies)
Discussion started by: sgffgs
3 Replies
ANDUMP(1)					    DICOM PS3 - Describe ACR-NEMA file content						 ANDUMP(1)

NAME
andump - ACR/NEMA DICOM PS3 ... Describe ACR-NEMA file content SYNOPSIS
andump [ -ancreate ] [ -extractCSA ] [ -showoffset|-showoffset-hex |-showoffset-octal|-showoffset-oct |-showoffset-decimal|-showoffset-dec ] [ -filename ] DESCRIPTION
andump reads the named acr-nema input file and describes the information contained, without attempting to interpret the structure of the message (cf. dcdump). The group and element number, dictionary and explicit value representation, description of tag, value length and value of the element are displayed, optionally with an offset byte count from the start of the file. OPTIONS
The attribute values, description and verbose output go to standard error. Binary attributes are written in hexadecimal with a preceding "0x". Numeric string attributes are written in decimal. Attribute values are displayed in hexadecimal or string format as determined by the value representation. The basic input switches are described in dcintro(1). Options specific to this program are: -ancreate Display item, end item and end sequence delimiter tags in a form suitable to feed into ancreate. -extractCSA Extract the DICOM-like attributes buried within the Siemens private CSA header OB value. -showoffset|-showoffset-hex Display byte offset from file start in hexadecimal. -showoffset-octal|-showoffset-oct Display byte offset from file start in octal. -showoffset-decimal|-showoffset-dec Display byte offset from file start in decimal. -filename Show the name of the file supplied in the arguments; a hyphen will be reported if no filename was supplied. ENVIRONMENT
EXAMPLES
% andump NM.dc3 (0x0008,0x0000) UL Group Length VR=<UL> VL=<0x0004> [0x08] (0x0008,0x0008) CS Image Type VR=<CS> VL=<0x0024> <...> ... (0x0054,0x0013) SQ ... Sequence VR=<SQ> VL=<0xffffffff> [] (0xfffe,0xe000) NONE Item VR=<> VL=<0xffffffff> [] (0x0054,0x0014) DS Energy Win LL VR=<DS> VL=<0x0006> <1.0 > (0x0054,0x0015) DS Energy Win UL VR=<DS> VL=<0x0006> <9.0 > (0xfffe,0xe00d) NONE Item Del .. VR=<> VL=<0x0000> [] (0xfffe,0xe0dd) NONE Seq Del .. VR=<> VL=<0x0000> [] ... % andump -ancreate NM.dc3 (0x0008,0x0000) UL Group Length VR=<UL> VL=<0x0004> [0x08] (0x0008,0x0008) CS Image Type VR=<CS> VL=<0x0024> <...> ... (0x0054,0x0013) SQ ... Sequence VR=<SQ> VL=<0xffffffff> [] %item (0x0054,0x0014) DS Energy Win LL VR=<DS> VL=<0x0006> <1.0 > (0x0054,0x0015) DS Energy Win UL VR=<DS> VL=<0x0006> <9.0 > %enditem %endseq ... FILES
SEE ALSO
ancreate(1), dcdump(1), dcintro(1) AUTHOR
Copyright (C) 1993-2010. David A. Clunie DBA PixelMed Publishing. All rights reserved. BUGS
DICOM PS3 6 March 2007 ANDUMP(1)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy