<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dec to hex with awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365969#M867191</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I can convert from hex to dec but I seem to get lost from dec to hex within "AWK". Harry once showed me the hex to dec.&lt;BR /&gt;&lt;BR /&gt;Any Ideas&lt;BR /&gt;&lt;BR /&gt;Many Thanks&lt;BR /&gt;Chris</description>
    <pubDate>Thu, 26 Aug 2004 10:55:55 GMT</pubDate>
    <dc:creator>Chris Frangandonis</dc:creator>
    <dc:date>2004-08-26T10:55:55Z</dc:date>
    <item>
      <title>Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365969#M867191</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I can convert from hex to dec but I seem to get lost from dec to hex within "AWK". Harry once showed me the hex to dec.&lt;BR /&gt;&lt;BR /&gt;Any Ideas&lt;BR /&gt;&lt;BR /&gt;Many Thanks&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 26 Aug 2004 10:55:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365969#M867191</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2004-08-26T10:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365970#M867192</link>
      <description>You need the printf %x notification;&lt;BR /&gt;&lt;BR /&gt;eg:&lt;BR /&gt;&lt;BR /&gt;echo 10 | awk '{printf("%x\n",$1)}'&lt;BR /&gt;a&lt;BR /&gt;&lt;BR /&gt;echo 11 | awk '{printf("%x\n",$1)}'&lt;BR /&gt;b&lt;BR /&gt;&lt;BR /&gt;echo 244 | awk '{printf("%x\n",$1)}'&lt;BR /&gt;f4</description>
      <pubDate>Thu, 26 Aug 2004 11:14:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365970#M867192</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2004-08-26T11:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365971#M867193</link>
      <description>Hi Chris,&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;What how about if I got it in a function and need to define it so as to printf it. e.g&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;            ###########################&lt;BR /&gt;            function get_info(file) &lt;BR /&gt;            ###########################&lt;BR /&gt;           &lt;BR /&gt;            {&lt;BR /&gt;            e_b="LookFor"&lt;BR /&gt;            SEA="*"$6"."$7"&lt;BR /&gt;            {if (match($7,"swing")){&lt;BR /&gt;            TOOL="/usr/bin/which CheckFor "&lt;BR /&gt;            TOOL | getline TOOL2;close(TOOL)&lt;BR /&gt;            #this is where I need to substr and the convert to Dec&lt;BR /&gt;&lt;BR /&gt;Once Again Thanks&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 11:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365971#M867193</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2004-08-26T11:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365972#M867194</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;  You can also do with adb.&lt;BR /&gt;&lt;BR /&gt;  echo "0D&lt;DEC-NUMBER&gt;=X" | adb&lt;BR /&gt;&lt;BR /&gt;-- Sundar.&lt;BR /&gt;&lt;BR /&gt;&lt;/DEC-NUMBER&gt;</description>
      <pubDate>Thu, 26 Aug 2004 11:30:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365972#M867194</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-08-26T11:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365973#M867195</link>
      <description>&lt;BR /&gt;Within an awk program/script just use 'sprintf' to print to a string:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN{x=sprintf("%0X",30);print x,x,x}'&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 11:46:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365973#M867195</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-08-26T11:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365974#M867196</link>
      <description>Hi Hein,&lt;BR /&gt;&lt;BR /&gt;Thanks that was great,(rusting). What if I have a date 20040818040320 &lt;BR /&gt;&lt;BR /&gt;YER=sprintf("%s",(substr($1,3,2))) &lt;BR /&gt;MON=sprintf("%0x",(substr($1,5,2))) &lt;BR /&gt;DAY=sprintf("%0x",(substr($1,7,2))) (this will be 18 = 12&lt;BR /&gt;HH=sprintf("%0x",(substr($2,7,2))) 04 = 4 &lt;BR /&gt;etc&lt;BR /&gt;I would like to define it a the end e.g&lt;BR /&gt;YMDHMS= YERMONDAYHH so as to used it for a search pattern.&lt;BR /&gt;In the hour (04), converting it to dec will be 4 (048124) which is what I am not looking for. What I would like the result to be "040812040332"&lt;BR /&gt;&lt;BR /&gt;Any Ideas&lt;BR /&gt;&lt;BR /&gt;Thanks Again&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 12:08:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365974#M867196</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2004-08-26T12:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365975#M867197</link>
      <description>&lt;BR /&gt;Now you confused me on when you are goign from hex to dec or back. Still, never mind, the basic formatting principle apply:&lt;BR /&gt;For example "%02X"&lt;BR /&gt;% = format coming up!&lt;BR /&gt;0 = leading 0 requestion&lt;BR /&gt;2 = fieldsize 2&lt;BR /&gt;X = upcased hexadecimal (vs x for lower, and d for decimal)&lt;BR /&gt;&lt;BR /&gt;And you can combine lots of formats, with lots of (prefereably as many :-) input in a single sprintf giving something like:&lt;BR /&gt;&lt;BR /&gt;echo "20040818040320" | awk '{x=sprintf("%s%02X%02X%02d",substr($1,3,2),substr($1,5,2),substr($1,7,2),substr($1,9,2));print x}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You'll have to verify spaces and X and d usage.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 12:55:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365975#M867197</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-08-26T12:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dec to hex with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365976#M867198</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;Great explanation with 10. Its all coming back to me.&lt;BR /&gt;&lt;BR /&gt;Anyway Thanks to all role players.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 13:53:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dec-to-hex-with-awk/m-p/3365976#M867198</guid>
      <dc:creator>Chris Frangandonis</dc:creator>
      <dc:date>2004-08-26T13:53:39Z</dc:date>
    </item>
  </channel>
</rss>

