<?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 Re: Text Allignment problem. ? with TAB space. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924675#M408599</link>
    <description>Thanks Patric , James, Rick , Volker ..&lt;BR /&gt;&lt;BR /&gt;And Thanks all , its working. &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 08 Sep 2005 14:31:17 GMT</pubDate>
    <dc:creator>rveri</dc:creator>
    <dc:date>2005-09-08T14:31:17Z</dc:date>
    <item>
      <title>Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924666#M408590</link>
      <description>Hi All , &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am Trying to print like this :  username , uid , gid , gecos&lt;BR /&gt;&lt;BR /&gt;With this command.  But the allignment is getting disturbed.&lt;BR /&gt;Can any one tell , how to allign 2nd field , so that it will maintain in same column.??&lt;BR /&gt;&lt;BR /&gt;$ sort -t: -k 3n,3 passwd | awk -F ":" '{ print $1 ,"\t","\t","\t",$3,"\t","\t",$4,"\t",$5}' | more&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;nobody                   -2              -24&lt;BR /&gt;root                     0               3&lt;BR /&gt;daemon                   1               5&lt;BR /&gt;bin                      2               2&lt;BR /&gt;sys                      3               3&lt;BR /&gt;adm                      4               4&lt;BR /&gt;uucp                     5               3&lt;BR /&gt;lp                       9               7&lt;BR /&gt;nuucp                    11              11&lt;BR /&gt;hpdb                     27              1       ALLBASE&lt;BR /&gt;sna                      28              21      SNAplus2 User,,,&lt;BR /&gt;www                      30              1&lt;BR /&gt;sybase                   100             101     ,,,&lt;BR /&gt;oracle                   101             101     Oracle DBA,,,&lt;BR /&gt;dbaumgr                          102             102     ,,,&lt;BR /&gt;dptrans                          103             22      File transfer,,,&lt;BR /&gt;d_mirror                         104             101     data mirror,x7103,,&lt;BR /&gt;sshd                     107             103     sshd privsep&lt;BR /&gt;uua332                   108             104     User34,username;Location2;ad2&lt;BR /&gt;tpcak                    109             104     User35, Username2;Location3;ad3&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Thanks ,&lt;BR /&gt;Veri.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 13:33:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924666#M408590</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2005-09-08T13:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924667#M408591</link>
      <description>Sorry , in the forum text box the output is not displaying properly ,&lt;BR /&gt;&lt;BR /&gt;here is the attachment , that will show clear about the problem. (can be opened with wordpad. )&lt;BR /&gt;&lt;BR /&gt;Thanks , &lt;BR /&gt;Veri.</description>
      <pubDate>Thu, 08 Sep 2005 13:37:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924667#M408591</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2005-09-08T13:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924668#M408592</link>
      <description>Use printf instead of just print.&lt;BR /&gt;&lt;BR /&gt;If you want the names left justified:&lt;BR /&gt;&lt;BR /&gt;sort -t: -k 3n,3 passwd | awk -F ":" '{ printf("%-20s,%s,%s,%s\n",$1,$3,$4,$5) }'&lt;BR /&gt;&lt;BR /&gt;If you want the names right justified:&lt;BR /&gt;sort -t: -k 3n,3 passwd | awk -F ":" '{ printf("%20s,%s,%s,%s\n",$1,$3,$4,$5) }'&lt;BR /&gt;&lt;BR /&gt;You can change the 20 in %20s to the length of your longest user name.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 13:41:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924668#M408592</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-09-08T13:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924669#M408593</link>
      <description>Hi Veri:&lt;BR /&gt;&lt;BR /&gt;# sort -t: -k3n,3 passwd | awk -F ":" '{printf "%12s %4d %4d %s\n",$1,$3,$4,$5}' &lt;BR /&gt;&lt;BR /&gt;...adjusting the widths to suit your tastes/needs.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try something like this:&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 13:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924669#M408593</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-08T13:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924670#M408594</link>
      <description>The various names you get as resuly have different lengths so the tab setting is unreliable&lt;BR /&gt;&lt;BR /&gt;Use the 'printf' &lt;BR /&gt;sort -t: -k 3n,3 passwd | awk -F ":" '{ printf &lt;BR /&gt;%-9s %-4s %-4s %-25s\n", $1, $3, $4, $5}' | more&lt;BR /&gt;&lt;BR /&gt;You are defining the length of the fields to print. Example, $1 has 9 characters, $3 has 4 characters, etc...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 13:44:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924670#M408594</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-09-08T13:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924671#M408595</link>
      <description>Hello,&lt;BR /&gt;not exactly sure, but&lt;BR /&gt;&lt;BR /&gt;printf "%-20s\t%10s\t%10s\t%s\n", $1,$3,$4,$5 }&lt;BR /&gt;&lt;BR /&gt;should do the job in nice formatting.&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 08 Sep 2005 13:44:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924671#M408595</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2005-09-08T13:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924672#M408596</link>
      <description>If you want more padding between columns (I didn't see your 2nd post until after I originally responded):&lt;BR /&gt;&lt;BR /&gt;sort -t: -k 3n,3 passwd | awk -F ":" '{ printf("%20s %7s %7s %s\n",$1,$3,$4,$5) }'&lt;BR /&gt;&lt;BR /&gt;Change the numbers in the %#s statements to whatever value you want.&lt;BR /&gt;&lt;BR /&gt;man awk&lt;BR /&gt;&lt;BR /&gt;and look at the printf section for more info.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 13:46:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924672#M408596</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-09-08T13:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924673#M408597</link>
      <description>Hi All , &lt;BR /&gt;&lt;BR /&gt;Patrick, James works fine , &lt;BR /&gt;Ricks one gives error :&lt;BR /&gt;&lt;BR /&gt;$ sort -t: -k 3n,3 passwd | awk -F ":" '{ printf %-9s %-4s %-4s %-25s\n", $1, $3, $4, $5}' | more&lt;BR /&gt; syntax error The source line is 1.&lt;BR /&gt; The error context is&lt;BR /&gt;                { printf &amp;gt;&amp;gt;&amp;gt;  % &amp;lt;&amp;lt;&amp;lt; -9s %-4s %-4s %-25s\n", $1, $3, $4, $5}&lt;BR /&gt; awk: The statement cannot be correctly parsed.&lt;BR /&gt; The source line is 1.&lt;BR /&gt;$&lt;BR /&gt;--------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;And Patrick's last one excellent , Patrick, how to make the names  left allinged.&lt;BR /&gt;&lt;BR /&gt;Thanks all,&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 14:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924673#M408597</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2005-09-08T14:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924674#M408598</link>
      <description>To left align, make the %20s be %-20s and you it should work.&lt;BR /&gt;&lt;BR /&gt;The command would then be:&lt;BR /&gt;&lt;BR /&gt;sort -t: -k 3n,3 passwd | awk -F ":" '{ printf("%-20s %7s %7s %s\n",$1,$3,$4,$5) }'&lt;BR /&gt;&lt;BR /&gt;You can do the same on any of the fields.</description>
      <pubDate>Thu, 08 Sep 2005 14:24:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924674#M408598</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-09-08T14:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924675#M408599</link>
      <description>Thanks Patric , James, Rick , Volker ..&lt;BR /&gt;&lt;BR /&gt;And Thanks all , its working. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 14:31:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924675#M408599</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2005-09-08T14:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924676#M408600</link>
      <description>Got solution. You all are .Excellent.</description>
      <pubDate>Thu, 08 Sep 2005 14:32:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924676#M408600</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2005-09-08T14:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924677#M408601</link>
      <description>Sorry rveri, mine is missing the double quotes at the beginning.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 14:38:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924677#M408601</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-09-08T14:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Text Allignment problem. ? with TAB space.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924678#M408602</link>
      <description>No Problem , &lt;BR /&gt;Now I understood the syntax and details of %s with printf  , and worked fine. Thanks for all the help and quick replies.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2005 14:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-allignment-problem-with-tab-space/m-p/4924678#M408602</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2005-09-08T14:49:32Z</dc:date>
    </item>
  </channel>
</rss>

