Sponsored Content
Top Forums Shell Programming and Scripting How to convert a file containing hex code to decimal using script? Post 302651101 by necro98 on Tuesday 5th of June 2012 12:56:33 AM
Old 06-05-2012
Thanks chubler , i got it , please can you let me know how we can remove words "0.0.0.0" from the output

Code:
20120605144619 207.18.129.6 10.10.50.9 0.0.0.0 10.10.50.249 10.10.39.42 c:0
 
20120605144619 243.243.247.212 10.10.50.9 10.10.39.42 0.0.0.0 0.0.0.0 c:3


Last edited by necro98; 06-05-2012 at 04:01 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

hex to decimal

hi all, echo "ibase=16;obase=10;11" | bc shouldn't i get 17? i am getting 11 i am trying to convert 11 (hex) to decimal stuck! JAK (4 Replies)
Discussion started by: jakSun8
4 Replies

2. Shell Programming and Scripting

having a bash script convert ft to meters with 1 decimal

What is the correct syntax to limit the number of decimals to 1 or 0 in a bash script? Here is the partial code I have which works, but if I echo $meters, it has 4 or 5 decimals: METERS=`echo "$FEET * 0.3048" | bc` I read about scale and length in the bc man page, but I can't seem to get the... (2 Replies)
Discussion started by: audiophile
2 Replies

3. 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

4. Shell Programming and Scripting

Convert hex to decimal or reverse is better?

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)
Discussion started by: Axel82
4 Replies

5. Shell Programming and Scripting

Decimal to hex conversion

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)
Discussion started by: The_Archer
11 Replies

6. UNIX for Advanced & Expert Users

Convert 32 bit hex value into fields in decimal

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

7. 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

8. Programming

Urgent help needed.. C++ program to convert decimal to hexa decimal

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

9. Shell Programming and Scripting

Convert Binary File To Hex In Linux

dHi, I have the attached file(actual file can be extracted post unzipping it) & i am trying to use the following code for coversion to hex format. Starting hex value is 84 which is start of the record & termination is done using 00 00 followed by 84(hex) which i can see in the dump clearly using... (14 Replies)
Discussion started by: siramitsharma
14 Replies

10. Shell Programming and Scripting

Print hex Ip address in decimal format inside awk script

Hi to all, May someone help me with the following. The awk script below is part of a bigger awk script, and this part attempts to print an Ip address that is in hex format in decimal format. I'm trying with following code but I'm getting 0.0.0.0 and the correct answer is 192.168.140.100 ... (9 Replies)
Discussion started by: Ophiuchus
9 Replies
iconv_8859-2(5) 					Standards, Environments, and Macros					   iconv_8859-2(5)

NAME
iconv_8859-2 - code set conversion tables for ISO 8859-2 (Latin 2) DESCRIPTION
The following code set conversions are supported: +--------------------------------------------------------------------+ | Code Set Conversions Supported | +--------------+--------+--------------+--------+--------------------+ | Code |Symbol |Target Code |Symbol | Target Output | +--------------+--------+--------------+--------+--------------------+ |ISO 8859-2 |iso2 |MS 1250 |win2 | Windows Latin 2 | +--------------+--------+--------------+--------+--------------------+ |ISO 8859-2 |iso2 |MS 852 |dos2 | MS-DOS Latin 2 | +--------------+--------+--------------+--------+--------------------+ |ISO 8859-2 |iso2 |Mazovia |maz | Mazovia | +--------------+--------+--------------+--------+--------------------+ |ISO 8859-2 |iso2 |DHN |dhn | Dom Handlowy Nauki | +--------------+--------+--------------+--------+--------------------+ CONVERSIONS
The conversions are performed according to the following tables. All values in the tables are given in octal. ISO 8859-2 to MS 1250 For the conversion of ISO 8859-2 to MS 1250, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 8859-2 | MS 1250 | ISO 8859-2 | MS 1250 | |24 | 4 |261 |271 | |177-237 | 40 |265 |276 | |241 | 245 |266 |234 | |245 | 274 |267 |241 | |246 | 214 |271 |232 | |251 | 212 |273 |235 | |253 | 215 |274 |237 | |254 | 217 |276 |236 | |256 | 216 |266 |236 | +---------------+----------------+----------------+---------------+ ISO 8859-2 to MS 852 For the conversion of ISO 8859-2 to MS 852, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 8859-2 | MS 852 | ISO 8859-2 | MS 852 | |24 | 4 |316 |327 | |177-237 | 40 |317 |322 | |240 | 377 |320 |321 | |241 | 244 |321 |343 | |242 | 364 |322 |325 | |243 | 235 |323 |340 | |244 | 317 |324 |342 | |245 | 225 |325 |212 | |246 | 227 |326 |231 | |247 | 365 |327 |236 | |250 | 371 |330 |374 | |251 | 346 |331 |336 | |252 | 270 |332 |351 | |253 | 233 |333 |353 | |254 | 215 |334 |232 | |255 | 360 |335 |355 | |256 | 246 |336 |335 | |257 | 275 |337 |341 | |260 | 370 |340 |352 | |261 | 245 |341 |240 | |262 | 362 |342 |203 | |263 | 210 |343 |307 | |264 | 357 |344 |204 | |265 | 226 |345 |222 | |266 | 230 |346 |206 | |267 | 363 |347 |207 | |270 | 367 |350 |237 | |271 | 347 |351 |202 | |272 | 255 |352 |251 | |273 | 234 |353 |211 | |274 | 253 |354 |330 | |275 | 361 |355 |241 | |276 | 247 |356 |214 | |277 | 276 |357 |324 | |300 | 350 |360 |320 | |301 | 265 |361 |344 | |302 | 266 |362 |345 | |303 | 306 |363 |242 | |304 | 216 |364 |223 | |305 | 221 |365 |213 | |306 | 217 |366 |224 | |307 | 200 |367 |366 | |310 | 254 |370 |375 | |311 | 220 |371 |205 | |312 | 250 |372 |243 | |313 | 323 |374 |201 | |314 | 267 |375 |354 | |315 | 326 |376 |356 | |366 | 367 | | | +---------------+----------------+----------------+---------------+ ISO 8859-2 to Mazovia For the conversion of ISO 8859-2 to Mazovia, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 8859-2 | Mazovia | ISO 8859-2 | Mazovia | |24 | 4 |323 |243 | |177-237 | 40 |324-325 |40 | |240 | 377 |326 |231 | |241 | 217 |327-333 |40 | |242 | 40 |334 |232 | |243 | 234 |335-336 |40 | |244-245 | 40 |337 |341 | |246 | 230 |340-341 |40 | |247-253 | 40 |342 |203 | |254 | 240 |343 |40 | |255-256 | 40 |344 |204 | |257 | 241 |345 |40 | |260 | 370 |346 |215 | |261 | 206 |347 |207 | |262 | 40 |350 |40 | |263 | 222 |351 |202 | |264-265 | 40 |352 |221 | |266 | 236 |353 |211 | |267-273 | 40 |354-355 |40 | |274 | 246 |356 |214 | |275-276 | 40 |357-360 |40 | |277 | 247 |361 |244 | |300-303 | 40 |362 |40 | |304 | 216 |363 |242 | |305 | 40 |364 |223 | |306 | 225 |365 |40 | |307 | 200 |366 |224 | |310-311 | 40 |367 |366 | |312 | 220 |370-373 |40 | |313-320 | 40 |374 |201 | |321 | 245 |375-376 |40 | |322 | 40 | | | +---------------+----------------+----------------+---------------+ ISO 8859-2 to DHN For the conversion of ISO 8859-2 to DHN, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | ISO 8859-2 | DHN | ISO 8859-2 | DHN | |24 | 4 |322 |40 | |177-237 | 40 |323 |205 | |240 | 377 |324-325 |40 | |241 | 200 |326 |231 | |242 | 40 |327-333 |40 | |243 | 203 |334 |232 | |244-245 | 40 |335-336 |40 | |246 | 206 |337 |341 | |247-253 | 40 |340 |40 | |254 | 207 |341 |240 | |255-256 | 40 |342-345 |40 | |257 | 210 |346 |212 | |260 | 370 |347-351 |40 | |261 | 211 |352 |213 | |262 | 40 |353-354 |40 | |263 | 214 |355 |241 | |264-265 | 40 |356-360 |40 | |266 | 217 |361 |215 | |267-273 | 40 |362 |40 | |274 | 220 |363 |216 | |275-276 | 40 |364 |223 | |277 | 221 |365 |40 | |300-305 | 40 |366 |224 | |306 | 201 |367 |366 | |307-311 | 40 |370-371 |40 | |312 | 202 |372 |243 | |313-320 | 40 |373-376 |40 | |321 | 204 | | | +---------------+----------------+----------------+---------------+ FILES
/usr/lib/iconv/*.so conversion modules /usr/lib/iconv/*.t conversion tables /usr/lib/iconv/iconv_data list of conversions supported by conversion tables SEE ALSO
iconv(1), iconv(3C), iconv(5) SunOS 5.10 18 Apr 1997 iconv_8859-2(5)
All times are GMT -4. The time now is 04:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy