<?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: awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034405#M742905</link>
    <description>Awk can easily print lines longer than 72 characters so your question is unclear.&lt;BR /&gt;&lt;BR /&gt;In general, if you wish to format the output, printf rather than simply print is preferred.&lt;BR /&gt;&lt;BR /&gt;awk '{ printf ("%-10.10s %5s %-12.12s\n",$2,$3,$9") }' &lt;BR /&gt;&lt;BR /&gt;would print the 1st 3 fields in your example above followed by a LF. Awk's printf is modeled after the C printf function so man 3 printf for details although if you will try the above example, it should be fairly obvious what the above example does.</description>
    <pubDate>Mon, 09 Jul 2007 13:52:41 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2007-07-09T13:52:41Z</dc:date>
    <item>
      <title>awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034404#M742904</link>
      <description>awk  '{print $2"  "$3"  "$9"  "$10"  "$11"  "$12" "$13" "$14}' &amp;gt; $tf1&lt;BR /&gt;&lt;BR /&gt;Q: what is the correct syntax to copy all fields to create lines longer than 72 characters.&lt;BR /&gt;&lt;BR /&gt;Jacques</description>
      <pubDate>Mon, 09 Jul 2007 13:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034404#M742904</guid>
      <dc:creator>Jacques Carriere</dc:creator>
      <dc:date>2007-07-09T13:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034405#M742905</link>
      <description>Awk can easily print lines longer than 72 characters so your question is unclear.&lt;BR /&gt;&lt;BR /&gt;In general, if you wish to format the output, printf rather than simply print is preferred.&lt;BR /&gt;&lt;BR /&gt;awk '{ printf ("%-10.10s %5s %-12.12s\n",$2,$3,$9") }' &lt;BR /&gt;&lt;BR /&gt;would print the 1st 3 fields in your example above followed by a LF. Awk's printf is modeled after the C printf function so man 3 printf for details although if you will try the above example, it should be fairly obvious what the above example does.</description>
      <pubDate>Mon, 09 Jul 2007 13:52:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034405#M742905</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-09T13:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034406#M742906</link>
      <description>Hi Jacques&lt;BR /&gt;&lt;BR /&gt;awk '{if (length&amp;gt;72) {print length,  $0} }' file-name</description>
      <pubDate>Mon, 09 Jul 2007 14:26:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034406#M742906</guid>
      <dc:creator>Basheer_2</dc:creator>
      <dc:date>2007-07-09T14:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034407#M742907</link>
      <description>if I reduce my display screen to execute my script, awk does not copy all fields. Can someone give me the correct syntax to force awk to copy all fields no matter the size of the display screen.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jul 2007 15:06:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034407#M742907</guid>
      <dc:creator>Jacques Carriere</dc:creator>
      <dc:date>2007-07-09T15:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034408#M742908</link>
      <description>Note that in your example, you are redirecting stdout to a file and thus the screen size is completely irrelevant. I suspect that the actual problem is that your terminal is set to no eol wrap and anything beyond the width of the terminal is being truncated for display purposes although the data exist in the file. The actual limit on awk line length (record size) is 3000 characters and you are nowhere near that. If you use the Gnu version of awk even that 3000 character limit goes away.</description>
      <pubDate>Mon, 09 Jul 2007 15:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034408#M742908</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-09T15:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034409#M742909</link>
      <description>Along was what Clay says, if you want to see what's in your file you can use several dumping commands:&lt;BR /&gt;$ vis -n file&lt;BR /&gt;$ xd -tc file</description>
      <pubDate>Tue, 10 Jul 2007 06:41:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034409#M742909</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-10T06:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034410#M742910</link>
      <description>If I reduce my display screen, I only get a few fields copied. I expand the display screen, I get everything copied correctly eventhough awk is executed from inside a script. What can I do to tell awk to extract all my fields?&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Jul 2007 15:33:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034410#M742910</guid>
      <dc:creator>Jacques Carriere</dc:creator>
      <dc:date>2007-07-10T15:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034411#M742911</link>
      <description>I simply don't know how to explain this any better than to say that the data are there but are not all being displayed on your terminal (or terminal emulator). If you can enable eolwrap then you will probably see the data.&lt;BR /&gt;&lt;BR /&gt;Try running the attached script. It will produce a line much longer than 72 chars and then send it to awk. It will then attempt to print it field by field. Finally the input file is comapred to the output file. I expect a null output from diff.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Jul 2007 15:57:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/4034411#M742911</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-10T15:57:59Z</dc:date>
    </item>
  </channel>
</rss>

