<?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 awk help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262146#M659909</link>
    <description>Hi ALL,&lt;BR /&gt;&lt;BR /&gt;I am doing an awk on a file and getting the output as below, is there a way I can have spacing between $2 and $4 so that $4 is lined up symmetrically unlike what I am getting below?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk -F: '{print $2"\t\t\t"$4}' filename&lt;BR /&gt;&lt;BR /&gt;xxxxxxxxxxxxx                  8581&lt;BR /&gt;xxx                  8585&lt;BR /&gt;xxxxxx                    8590&lt;BR /&gt;xxxx                  8595&lt;BR /&gt;xxxxxxx               9400&lt;BR /&gt;xx                   9510&lt;BR /&gt;xxxxxxxxxxxxxxx                9520&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
    <pubDate>Tue, 09 Nov 2010 19:05:59 GMT</pubDate>
    <dc:creator>Allanm</dc:creator>
    <dc:date>2010-11-09T19:05:59Z</dc:date>
    <item>
      <title>awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262146#M659909</link>
      <description>Hi ALL,&lt;BR /&gt;&lt;BR /&gt;I am doing an awk on a file and getting the output as below, is there a way I can have spacing between $2 and $4 so that $4 is lined up symmetrically unlike what I am getting below?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk -F: '{print $2"\t\t\t"$4}' filename&lt;BR /&gt;&lt;BR /&gt;xxxxxxxxxxxxx                  8581&lt;BR /&gt;xxx                  8585&lt;BR /&gt;xxxxxx                    8590&lt;BR /&gt;xxxx                  8595&lt;BR /&gt;xxxxxxx               9400&lt;BR /&gt;xx                   9510&lt;BR /&gt;xxxxxxxxxxxxxxx                9520&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Tue, 09 Nov 2010 19:05:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262146#M659909</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-11-09T19:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262147#M659910</link>
      <description>&amp;gt;&amp;gt; symmetrically&lt;BR /&gt;&lt;BR /&gt;Not sure anyone understand clearly what that means.&lt;BR /&gt;Terms folks tend to understand are columns and field and left of right aligned.&lt;BR /&gt;&lt;BR /&gt;Anyway...&lt;BR /&gt;&lt;BR /&gt;Use a PRINTF instead of PRINT&lt;BR /&gt;Use '%-?ns' for a left-aligned ?-columns wide string field.&lt;BR /&gt;&lt;BR /&gt;For the second column ($4) you may want a %0?d formatting if you want to play with leading zeroes.&lt;BR /&gt;&lt;BR /&gt;Read any C, AWK, PERL or SHell book or man-page for all the details.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For example, using your output as input:&lt;BR /&gt;&lt;BR /&gt;$ awk '{printf ("%-20s%6s\n",$1,$2)}' x.x&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Nov 2010 19:16:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262147#M659910</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-11-09T19:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262148#M659911</link>
      <description>yep, use printf</description>
      <pubDate>Tue, 09 Nov 2010 19:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262148#M659911</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2010-11-09T19:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262149#M659912</link>
      <description>The original awk statement worked for me once I redirected the output to xls file.</description>
      <pubDate>Tue, 09 Nov 2010 23:29:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5262149#M659912</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-11-09T23:29:37Z</dc:date>
    </item>
  </channel>
</rss>

