<?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 - printing all fields other than first field in a variable length record in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501722#M728435</link>
    <description>OK..try this..I used the /etc/passwd for my test.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;cat /etc/passwd | awk -F: '&lt;BR /&gt; {for (i=2; i &amp;lt;= NF ; i++) print "Field",i,": ",$i}'&lt;BR /&gt;&lt;BR /&gt;If I've retyped this right, ... &lt;BR /&gt;&lt;BR /&gt;/rcw&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 06 Mar 2001 21:10:42 GMT</pubDate>
    <dc:creator>Rita C Workman</dc:creator>
    <dc:date>2001-03-06T21:10:42Z</dc:date>
    <item>
      <title>awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501713#M728426</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;How do you print all fields other than the first field in a variable length record using awk utility ? The field delimiter is space.&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Bala&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Mar 2001 19:14:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501713#M728426</guid>
      <dc:creator>Bala_4</dc:creator>
      <dc:date>2001-03-06T19:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501714#M728427</link>
      <description>$0 should print the whole line.&lt;BR /&gt;&lt;BR /&gt;awk '{ print $0 }'&lt;BR /&gt;&lt;BR /&gt;For example:  awk '{ print $0 }' &amp;lt; /tmp/test&lt;BR /&gt;&lt;BR /&gt;will print the contents of the file /tmp/test no matter what the line length.</description>
      <pubDate>Tue, 06 Mar 2001 20:04:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501714#M728427</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-06T20:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501715#M728428</link>
      <description>Hi &lt;BR /&gt;I donot want to print the first field. $0 will print the full record. I want to print from second field to last field. Here the last field is not fixed since it is a variable length record.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Mar 2001 20:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501715#M728428</guid>
      <dc:creator>Bala_4</dc:creator>
      <dc:date>2001-03-06T20:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501716#M728429</link>
      <description>Hi Bala:&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# echo "a b c \nd e f"|awk '{array [NF]=$0;for (i=2;i&amp;lt;=NF;i++) printf("%s ",$i);printf("\n")}'&lt;BR /&gt;&lt;BR /&gt;This will echo two lines:&lt;BR /&gt;&lt;BR /&gt;b c&lt;BR /&gt;e f&lt;BR /&gt;&lt;BR /&gt;...which represent the second through last fields of the two records input by example.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 06 Mar 2001 20:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501716#M728429</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-03-06T20:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501717#M728430</link>
      <description>Bala :&lt;BR /&gt;   You can use $1 $2 ... $n to print the individual fields of the current record.&lt;BR /&gt;&lt;BR /&gt;...Madhu</description>
      <pubDate>Tue, 06 Mar 2001 20:45:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501717#M728430</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2001-03-06T20:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501718#M728431</link>
      <description>You'll need to do something like the following...&lt;BR /&gt;&lt;BR /&gt;# cat /etc/passwd|while read LINE;do&lt;BR /&gt;&amp;gt; echo $LINE|awk -F":" '{split($0,a)}&lt;BR /&gt;&amp;gt;                       {for(i=2;i&amp;lt;=NF;i++) print a[i]}'&lt;BR /&gt;&amp;gt; done&lt;BR /&gt;&lt;BR /&gt;This prints out everything except the first field of the /etc/passwd file.</description>
      <pubDate>Tue, 06 Mar 2001 20:46:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501718#M728431</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2001-03-06T20:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501719#M728432</link>
      <description>Try this.  It will cat a file and look at field 1 and delete it, and then look at the first space on the line and delete it and then print the rest of the record.&lt;BR /&gt;&lt;BR /&gt;cat test | awk '{sub($1,"");sub(" ","");print}'</description>
      <pubDate>Tue, 06 Mar 2001 20:53:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501719#M728432</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-06T20:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501720#M728433</link>
      <description>Try this.  It will cat a file and look at field 1 and delete it, and then look at the first space on the line and delete it and then print the rest of the record.&lt;BR /&gt;&lt;BR /&gt;cat test | awk '{sub($1,"");sub(" ","");print}'</description>
      <pubDate>Tue, 06 Mar 2001 20:53:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501720#M728433</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-06T20:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501721#M728434</link>
      <description>Sorry for the duplication of the last post.  It wasn't obvious that it actually took my post.&lt;BR /&gt;&lt;BR /&gt;Here is some sample output from my last post:&lt;BR /&gt;&lt;BR /&gt;The test file first:&lt;BR /&gt;# cat test&lt;BR /&gt;this is line 1&lt;BR /&gt;this is another line in the file&lt;BR /&gt;this is line 3&lt;BR /&gt;this is yet another line in the test file&lt;BR /&gt;line 4&lt;BR /&gt;&lt;BR /&gt;And now running the command:&lt;BR /&gt;# cat test | awk '{sub($1,"");sub(" ","");print}'&lt;BR /&gt;is line 1&lt;BR /&gt;is another line in the file&lt;BR /&gt;is line 3&lt;BR /&gt;is yet another line in the test file&lt;BR /&gt;4&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Mar 2001 20:55:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501721#M728434</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-06T20:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501722#M728435</link>
      <description>OK..try this..I used the /etc/passwd for my test.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;cat /etc/passwd | awk -F: '&lt;BR /&gt; {for (i=2; i &amp;lt;= NF ; i++) print "Field",i,": ",$i}'&lt;BR /&gt;&lt;BR /&gt;If I've retyped this right, ... &lt;BR /&gt;&lt;BR /&gt;/rcw&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Mar 2001 21:10:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501722#M728435</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2001-03-06T21:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501723#M728436</link>
      <description>Instead of awk, how about using "cut". Like-&lt;BR /&gt;cut -d" " -f 2- filename</description>
      <pubDate>Tue, 06 Mar 2001 21:34:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501723#M728436</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-03-06T21:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501724#M728437</link>
      <description>Hi Bala ,&lt;BR /&gt;&lt;BR /&gt;Try this :&lt;BR /&gt;&lt;BR /&gt;cat yourfile | awk '{  $1="" ; print $0 }'</description>
      <pubDate>Tue, 06 Mar 2001 21:34:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501724#M728437</guid>
      <dc:creator>Vikas Khator</dc:creator>
      <dc:date>2001-03-06T21:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501725#M728438</link>
      <description>Hi Everone&lt;BR /&gt;Here is a simple solution which I found.&lt;BR /&gt;&lt;BR /&gt;awk '{$1="";print}'&lt;BR /&gt;&lt;BR /&gt;Thanks for all the help&lt;BR /&gt;Bala&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Mar 2001 21:36:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501725#M728438</guid>
      <dc:creator>Bala_4</dc:creator>
      <dc:date>2001-03-06T21:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: awk - printing all fields other than first field in a variable length record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501726#M728439</link>
      <description>Bala :&lt;BR /&gt;   Feel free to assign points.&lt;BR /&gt;...Madhu</description>
      <pubDate>Thu, 08 Mar 2001 19:35:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-printing-all-fields-other-than-first-field-in-a-variable/m-p/2501726#M728439</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2001-03-08T19:35:18Z</dc:date>
    </item>
  </channel>
</rss>

