Sponsored Content
Full Discussion: HEX number grouping
Top Forums Shell Programming and Scripting HEX number grouping Post 302477220 by Franklin52 on Friday 3rd of December 2010 04:26:51 PM
Old 12-03-2010
You could do something like:
Code:
echo "036A" | awk '
{
  printf("Group ID %04X, members;add members %04X:%04X to group ID %04X\n", hex2dec($1) ,hex2dec($1)+1, hex2dec($1)+3, hex2dec($1))
  printf("Group ID %04X, members;add members %04X:%04X to group ID %04X\n", hex2dec($1)+4 ,hex2dec($1)+5, hex2dec($1)+7, hex2dec($1)+4)
}
function hex2dec(h,i,x,v){
  h=tolower(h);sub(/^0x/,"",h)
  for(i=1;i<=length(h);++i){
    x=index("0123456789abcdef",substr(h,i,1))
    v=(16*v)+x-1
  }
  return v
}'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grouping of objects and print their number

hello have one file N H H K L K K H K N so output shud be like N = 2 H = 3 K = 4 L =1 (3 Replies)
Discussion started by: cdfd123
3 Replies

2. Shell Programming and Scripting

incremental addition of hex decimal number in one field

Hi I want to incremental add hex decimal number to a particula field in file eg: addr =123 dept1=0 addr = 345 dept2 =1 addr2 = 124 dept3 =2 . . . . . . addr3 =567 dept15 =f Is there any command which add... (8 Replies)
Discussion started by: diddi_linux
8 Replies

3. Programming

After converting the hexstr to Hex and storing the Hex in a char*

Hi All, My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ',' This has to be done for all the hexstring char* is NULL. Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies

4. Programming

What is the difference between ios::hex and std::hex?

Hi, Is there really a difference between these two, std::hex and ios::hex?? I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true? Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies

5. Shell Programming and Scripting

awk to remove leading zeros for a hex number

Is it possible by using awk to remove leading zeros for a hex number? ex: 0000000011179E0A -> 11179E0A Thank you! (4 Replies)
Discussion started by: carloszhang
4 Replies

6. Shell Programming and Scripting

awk to compare hex number

$ awk 'BEGIN{ pat111=0x1000000002E3E02; snBegin=0x1000000002E3E01; if (pat111<=snBegin) printf "a\n"}' a Result is not correct. Looks like the number is too big. Any idea? Thx! Please use code tags <- click the link! (2 Replies)
Discussion started by: carloszhang
2 Replies

7. Shell Programming and Scripting

Hex number sequence help

Need some help doing this ... with awk maybe Input 0DF6 0DF7 0DF8 0DF9 0DFA 0DFB 0DFC 0DFD 0DFF 0E00 0E01 0E02 0E03 0E04 0E05 0E06 (11 Replies)
Discussion started by: greycells
11 Replies

8. Shell Programming and Scripting

How to replace with "sed" some hex values by other hex values?

Assume I have a file \usr\home\\somedir\myfile123.txt and I want to replace all occurencies of the two (concatenated) hex values x'AD' x'A0' bytwo other (concatenated) hex values x'20' x'6E' How can I achieve this with the gnu sed tool? Additional question: Is there a way to let sed show... (1 Reply)
Discussion started by: pstein
1 Replies

9. Shell Programming and Scripting

Name grouping

awk 'FNR==NR {a; next} $NF in a' genes.txt refseq_exons.txt > output.txt I can not figure out how to group the same name in $4 together. Basically, all the SKI together in separate rows and all the TGFB2. Thank you :). chr1 2160133 2161174 SKI chr1 218518675 218520389 TGFB2... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. Shell Programming and Scripting

ksh : split hex number group

Hi, sry for poor english I have a group of hex number as : 4D40:4D42 I want so split this group in a list as : 4D40,4D41,4D42 i don't know how i can do this in ksh Thanks (5 Replies)
Discussion started by: jocazh
5 Replies
DateTime::Locale::ko_KR(3)				User Contributed Perl Documentation				DateTime::Locale::ko_KR(3)

NAME
DateTime::Locale::ko_KR SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ko_KR' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Korean South Korea. DATA
This locale inherits from the DateTime::Locale::ko locale. It contains the following data. Days Wide (format) XXX XXX XXX XXX XXX XXX XXX Abbreviated (format) X X X X X X X Narrow (format) X X X X X X X Wide (stand-alone) XXX XXX XXX XXX XXX XXX XXX Abbreviated (stand-alone) X X X X X X X Narrow (stand-alone) X X X X X X X Months Wide (format) 1X 2X 3X 4X 5X 6X 7X 8X 9X 10X 11X 12X Abbreviated (format) 1X 2X 3X 4X 5X 6X 7X 8X 9X 10X 11X 12X Narrow (format) 1X 2X 3X 4X 5X 6X 7X 8X 9X 10X 11X 12X Wide (stand-alone) 1X 2X 3X 4X 5X 6X 7X 8X 9X 10X 11X 12X Abbreviated (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Narrow (stand-alone) 1X 2X 3X 4X 5X 6X 7X 8X 9X 10X 11X 12X Quarters Wide (format) X 1/4XX X 2/4XX X 3/4XX X 4/4XX Abbreviated (format) 1XX 2XX 3XX 4XX Narrow (format) 1 2 3 4 Wide (stand-alone) X 1/4XX X 2/4XX X 3/4XX X 4/4XX Abbreviated (stand-alone) 1XX 2XX 3XX 4XX Narrow (stand-alone) 1 2 3 4 Eras Wide XXXXX XXXX Abbreviated XXX XX Narrow XXX XX Date Formats Full 2008-02-05T18:30:30 = 2008X 2X 5X XXX 1995-12-22T09:05:02 = 1995X 12X 22X XXX -0010-09-15T04:44:23 = -10X 9X 15X XXX Long 2008-02-05T18:30:30 = 2008X 2X 5X 1995-12-22T09:05:02 = 1995X 12X 22X -0010-09-15T04:44:23 = -10X 9X 15X Medium 2008-02-05T18:30:30 = 2008. 2. 5. 1995-12-22T09:05:02 = 1995. 12. 22. -0010-09-15T04:44:23 = -010. 9. 15. Short 2008-02-05T18:30:30 = 08. 2. 5. 1995-12-22T09:05:02 = 95. 12. 22. -0010-09-15T04:44:23 = -10. 9. 15. Default 2008-02-05T18:30:30 = 2008. 2. 5. 1995-12-22T09:05:02 = 1995. 12. 22. -0010-09-15T04:44:23 = -010. 9. 15. Time Formats Full 2008-02-05T18:30:30 = XX 06X 30X 30X UTC 1995-12-22T09:05:02 = XX 09X 05X 02X UTC -0010-09-15T04:44:23 = XX 04X 44X 23X UTC Long 2008-02-05T18:30:30 = XX 06X 30X 30X UTC 1995-12-22T09:05:02 = XX 09X 05X 02X UTC -0010-09-15T04:44:23 = XX 04X 44X 23X UTC Medium 2008-02-05T18:30:30 = XX 6:30:30 1995-12-22T09:05:02 = XX 9:05:02 -0010-09-15T04:44:23 = XX 4:44:23 Short 2008-02-05T18:30:30 = XX 6:30 1995-12-22T09:05:02 = XX 9:05 -0010-09-15T04:44:23 = XX 4:44 Default 2008-02-05T18:30:30 = XX 6:30:30 1995-12-22T09:05:02 = XX 9:05:02 -0010-09-15T04:44:23 = XX 4:44:23 Datetime Formats Full 2008-02-05T18:30:30 = 2008X 2X 5X XXXXX 06X 30X 30X UTC 1995-12-22T09:05:02 = 1995X 12X 22X XXXXX 09X 05X 02X UTC -0010-09-15T04:44:23 = -10X 9X 15X XXXXX 04X 44X 23X UTC Long 2008-02-05T18:30:30 = 2008X 2X 5XXX 06X 30X 30X UTC 1995-12-22T09:05:02 = 1995X 12X 22XXX 09X 05X 02X UTC -0010-09-15T04:44:23 = -10X 9X 15XXX 04X 44X 23X UTC Medium 2008-02-05T18:30:30 = 2008. 2. 5.XX 6:30:30 1995-12-22T09:05:02 = 1995. 12. 22.XX 9:05:02 -0010-09-15T04:44:23 = -010. 9. 15.XX 4:44:23 Short 2008-02-05T18:30:30 = 08. 2. 5.XX 6:30 1995-12-22T09:05:02 = 95. 12. 22.XX 9:05 -0010-09-15T04:44:23 = -10. 9. 15.XX 4:44 Default 2008-02-05T18:30:30 = 2008. 2. 5.XX 6:30:30 1995-12-22T09:05:02 = 1995. 12. 22.XX 9:05:02 -0010-09-15T04:44:23 = -010. 9. 15.XX 4:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 Ed (dX (E)) 2008-02-05T18:30:30 = 5X (X) 1995-12-22T09:05:02 = 22X (X) -0010-09-15T04:44:23 = 15X (X) EEEd (dX EEE) 2008-02-05T18:30:30 = 5X X 1995-12-22T09:05:02 = 22X X -0010-09-15T04:44:23 = 15X X HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 XX 1995-12-22T09:05:02 = 9:05 XX -0010-09-15T04:44:23 = 4:44 XX Hms (HX mX sX) 2008-02-05T18:30:30 = 18X 30X 30X 1995-12-22T09:05:02 = 9X 5X 2X -0010-09-15T04:44:23 = 4X 44X 23X hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 XX 1995-12-22T09:05:02 = 9:05:02 XX -0010-09-15T04:44:23 = 4:44:23 XX M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M. d.) 2008-02-05T18:30:30 = 2. 5. 1995-12-22T09:05:02 = 12. 22. -0010-09-15T04:44:23 = 9. 15. MEd (M. d. (E)) 2008-02-05T18:30:30 = 2. 5. (X) 1995-12-22T09:05:02 = 12. 22. (X) -0010-09-15T04:44:23 = 9. 15. (X) MMdd (MM. dd) 2008-02-05T18:30:30 = 02. 05 1995-12-22T09:05:02 = 12. 22 -0010-09-15T04:44:23 = 09. 15 MMM (LLL) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 MMMd (MMM dX) 2008-02-05T18:30:30 = 2X 5X 1995-12-22T09:05:02 = 12X 22X -0010-09-15T04:44:23 = 9X 15X MMMEd (MMM dX (E)) 2008-02-05T18:30:30 = 2X 5X (X) 1995-12-22T09:05:02 = 12X 22X (X) -0010-09-15T04:44:23 = 9X 15X (X) MMMMd (MMMM dX) 2008-02-05T18:30:30 = 2X 5X 1995-12-22T09:05:02 = 12X 22X -0010-09-15T04:44:23 = 9X 15X MMMMEd (MMMM dX (E)) 2008-02-05T18:30:30 = 2X 5X (X) 1995-12-22T09:05:02 = 12X 22X (X) -0010-09-15T04:44:23 = 9X 15X (X) mmss (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (yyyy. M.) 2008-02-05T18:30:30 = 2008. 2. 1995-12-22T09:05:02 = 1995. 12. -0010-09-15T04:44:23 = -010. 9. yMEd (yyyy. M. d. EEE) 2008-02-05T18:30:30 = 2008. 2. 5. X 1995-12-22T09:05:02 = 1995. 12. 22. X -0010-09-15T04:44:23 = -010. 9. 15. X yMMM (yX MMM) 2008-02-05T18:30:30 = 2008X 2X 1995-12-22T09:05:02 = 1995X 12X -0010-09-15T04:44:23 = -10X 9X yMMMd (yX MMM dX) 2008-02-05T18:30:30 = 2008X 2X 5X 1995-12-22T09:05:02 = 1995X 12X 22X -0010-09-15T04:44:23 = -10X 9X 15X yMMMEd (yX MMM dX EEE) 2008-02-05T18:30:30 = 2008X 2X 5X X 1995-12-22T09:05:02 = 1995X 12X 22X X -0010-09-15T04:44:23 = -10X 9X 15X X yMMMM (yX MMMM) 2008-02-05T18:30:30 = 2008X 2X 1995-12-22T09:05:02 = 1995X 12X -0010-09-15T04:44:23 = -10X 9X yQ (yX QXX) 2008-02-05T18:30:30 = 2008X 1XX 1995-12-22T09:05:02 = 1995X 4XX -0010-09-15T04:44:23 = -10X 3XX yQQQ (yX QQQ) 2008-02-05T18:30:30 = 2008X 1XX 1995-12-22T09:05:02 = 1995X 4XX -0010-09-15T04:44:23 = -10X 3XX yyMM (YY. M.) 2008-02-05T18:30:30 = 2008. 2. 1995-12-22T09:05:02 = 1995. 12. -0010-09-15T04:44:23 = -10. 9. yyMMM (yyX MMM) 2008-02-05T18:30:30 = 08X 2X 1995-12-22T09:05:02 = 95X 12X -0010-09-15T04:44:23 = -10X 9X yyQ (yyX QXX) 2008-02-05T18:30:30 = 08X 1XX 1995-12-22T09:05:02 = 95X 4XX -0010-09-15T04:44:23 = -10X 3XX yyyyMM (yyyy. MM) 2008-02-05T18:30:30 = 2008. 02 1995-12-22T09:05:02 = 1995. 12 -0010-09-15T04:44:23 = -010. 09 Miscellaneous Prefers 24 hour time? No Local first day of the week XXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::ko_KR(3)
All times are GMT -4. The time now is 02:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy