<?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/3252067#M175495</link>
    <description>hi masters,&lt;BR /&gt;   I have one file with 3 columns, i want to take the content of this file in a individual file based on substr(3,1,3) field.&lt;BR /&gt;&lt;BR /&gt;B---A213---206934875&lt;BR /&gt;B---A213---20534875&lt;BR /&gt;B---A213---207934875&lt;BR /&gt;.....&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;Space is indicated by "---" &lt;BR /&gt;i want three output files  as below,&lt;BR /&gt;File F206==&amp;gt; B---A213---206934875&lt;BR /&gt;File F205==&amp;gt; B---A213---20534875&lt;BR /&gt;File F207==&amp;gt; B---A213---207934875&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 19 Apr 2004 07:33:13 GMT</pubDate>
    <dc:creator>Ashwin_4</dc:creator>
    <dc:date>2004-04-19T07:33:13Z</dc:date>
    <item>
      <title>awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252067#M175495</link>
      <description>hi masters,&lt;BR /&gt;   I have one file with 3 columns, i want to take the content of this file in a individual file based on substr(3,1,3) field.&lt;BR /&gt;&lt;BR /&gt;B---A213---206934875&lt;BR /&gt;B---A213---20534875&lt;BR /&gt;B---A213---207934875&lt;BR /&gt;.....&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;Space is indicated by "---" &lt;BR /&gt;i want three output files  as below,&lt;BR /&gt;File F206==&amp;gt; B---A213---206934875&lt;BR /&gt;File F205==&amp;gt; B---A213---20534875&lt;BR /&gt;File F207==&amp;gt; B---A213---207934875&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Apr 2004 07:33:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252067#M175495</guid>
      <dc:creator>Ashwin_4</dc:creator>
      <dc:date>2004-04-19T07:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252068#M175496</link>
      <description>How about a little shell script&lt;BR /&gt; &lt;BR /&gt;IFS="&lt;BR /&gt;"&lt;BR /&gt;for i in `cat datafile`&lt;BR /&gt;do&lt;BR /&gt;        newfile=`expr "$i" : ".......\(...\)"`&lt;BR /&gt;        echo "$i" &amp;gt; "F$newfile"&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Apr 2004 07:41:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252068#M175496</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-19T07:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252069#M175497</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Based on&lt;BR /&gt;&lt;BR /&gt;B   A213   206934875&lt;BR /&gt;B   A213   20534875&lt;BR /&gt;B   A213   207934875&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;in tmp/fil&lt;BR /&gt;&lt;BR /&gt;cat tmp/fil|while read line&lt;BR /&gt;do&lt;BR /&gt;echo $line|read a b c&lt;BR /&gt;name="F"$(echo $c|cut -c1-3)&lt;BR /&gt;echo "$line" &amp;gt; $name&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Based on&lt;BR /&gt;&lt;BR /&gt;B---A213---206934875&lt;BR /&gt;B---A213---20534875&lt;BR /&gt;B---A213---207934875&lt;BR /&gt;&lt;BR /&gt;cat tmp/fil|while read line&lt;BR /&gt;do&lt;BR /&gt;name="F"$(echo $line|cut -c12-14)&lt;BR /&gt;echo "$line" &amp;gt; $name&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;              Steve Steel</description>
      <pubDate>Mon, 19 Apr 2004 07:48:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252069#M175497</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2004-04-19T07:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252070#M175498</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Assuming the text in file "s.txt"&lt;BR /&gt;&lt;BR /&gt;Run &lt;BR /&gt;awk '{print "echo " $0 " &amp;gt;&amp;gt; F" substr($0,12,3) }' s.txt &amp;gt; foo.sh&lt;BR /&gt;&lt;BR /&gt;This will generate foo.sh&lt;BR /&gt;&lt;BR /&gt;Just run foo.sh will give you the result.&lt;BR /&gt;&lt;BR /&gt;Enjoy.&lt;BR /&gt;&lt;BR /&gt;Kartik</description>
      <pubDate>Mon, 19 Apr 2004 07:53:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252070#M175498</guid>
      <dc:creator>Kartik Gajjar</dc:creator>
      <dc:date>2004-04-19T07:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252071#M175499</link>
      <description>hi, &lt;BR /&gt;   Thanks for quick reply. shall we do it using "AWK"&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Mon, 19 Apr 2004 07:55:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252071#M175499</guid>
      <dc:creator>Ashwin_4</dc:creator>
      <dc:date>2004-04-19T07:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252072#M175500</link>
      <description>Why do you have to use awk?  Awk is good, don't get me wrong, but I don't think it's the best solution to your current problem.&lt;BR /&gt; &lt;BR /&gt;The awk solution posted above does not give you the additional files you wanted by the way.</description>
      <pubDate>Mon, 19 Apr 2004 08:13:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252072#M175500</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-19T08:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252073#M175501</link>
      <description>Actually, re-reading Kartik's script above, properly this time, it does give you the files and is an interesting solution to the problem.   &lt;BR /&gt; &lt;BR /&gt;Seems a little over the top to use awk to create a shell script when you can do it in a shell script to start with, however, 10 points for style on that one Kartik :)</description>
      <pubDate>Mon, 19 Apr 2004 08:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252073#M175501</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-19T08:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252074#M175502</link>
      <description>"awk" would be pretty straight forward-&lt;BR /&gt; &lt;BR /&gt;awk '{print $0 &amp;gt;"F" substr($3,1,3)}' &lt;YOURFILE&gt;&lt;/YOURFILE&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 19 Apr 2004 08:53:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/3252074#M175502</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-04-19T08:53:36Z</dc:date>
    </item>
  </channel>
</rss>

