<?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: scripting help required in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806440#M939729</link>
    <description>cat your_file|grep -v "#"|tr "\n" " "&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 16 Sep 2002 02:46:33 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2002-09-16T02:46:33Z</dc:date>
    <item>
      <title>scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806434#M939723</link>
      <description>Hi Experts,&lt;BR /&gt;Could somebody help me with a script that im trying to make. The idea is just reformating data....Example data:&lt;BR /&gt;############################&lt;BR /&gt;2&lt;BR /&gt;1.1  2.2 3.1 4.1 5.1 6.2 7.1 &lt;BR /&gt;9.1  9.2 9.6 9.8 9.8 8.2 3.4&lt;BR /&gt;1.1  2.2 3.1 4.1 5.1 6.2 7.1&lt;BR /&gt;1&lt;BR /&gt;1.1  2.2 3.1 4.1 5.1 6.2 7.1 &lt;BR /&gt;9.1  9.2 9.6 9.8 9.8 8.2 3.4&lt;BR /&gt;1.1  2.2 3.1 4.1 5.1 6.2 7.1&lt;BR /&gt;5&lt;BR /&gt;1.1  2.2 3.1 4.1 5.1 6.2 7.1 &lt;BR /&gt;9.1  9.2 9.6 9.8 9.8 8.2 3.4&lt;BR /&gt;1.1  2.2 3.1 4.1 5.1 6.2 7.1&lt;BR /&gt;############################&lt;BR /&gt;&lt;BR /&gt;The script should be able to go through the file and check for all lines containing 1 field and make all the associated data in to one row.&lt;BR /&gt;for example in this case for the first part:&lt;BR /&gt;&lt;BR /&gt;2 1.1  2.2 3.1 4.1 5.1 6.2 1.1&lt;BR /&gt;9.1  9.2 9.6 9.8 9.8 8.2 3.4 1.1  2.2 3.1 4.1 5.1 6.2 7.1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Soji&lt;BR /&gt;</description>
      <pubDate>Sun, 15 Sep 2002 04:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806434#M939723</guid>
      <dc:creator>george_57</dc:creator>
      <dc:date>2002-09-15T04:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806435#M939724</link>
      <description>2 1.1 2.2 3.1 4.1 5.1 6.2 7.1 9.1 9.2 9.6 9.8 9.8 8.2 3.4 1.1 2.2 3.1 4.1 5.1 6.2 7.1</description>
      <pubDate>Sun, 15 Sep 2002 05:55:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806435#M939724</guid>
      <dc:creator>george_57</dc:creator>
      <dc:date>2002-09-15T05:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806436#M939725</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Here is a quick script for your purpose,&lt;BR /&gt;&lt;BR /&gt;=====Begin&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;cat &lt;SOURCE file=""&gt; | grep -v "#" | while read LINE&lt;BR /&gt;do&lt;BR /&gt;if [ "$LINE" = "`echo $LINE | awk '{print $1}'`" ]&lt;BR /&gt;then&lt;BR /&gt;   echo $NEWLINE&lt;BR /&gt;   NEWLINE=$LINE&lt;BR /&gt;else&lt;BR /&gt;   NEWLINE=$NEWLINE" "$LINE&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;echo $NEWLINE&lt;BR /&gt;&lt;BR /&gt;======End&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Patrick&lt;/SOURCE&gt;</description>
      <pubDate>Sun, 15 Sep 2002 07:16:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806436#M939725</guid>
      <dc:creator>Patrick Chim</dc:creator>
      <dc:date>2002-09-15T07:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806437#M939726</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Perhaps this is what you need. Call it for example txt1 and use it "txt1 &lt;DATAFILE&gt;&lt;/DATAFILE&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;txt3()&lt;BR /&gt;{&lt;BR /&gt;case "$#" in&lt;BR /&gt;0)&lt;BR /&gt; echo $line ;;&lt;BR /&gt;1)&lt;BR /&gt; if [ -n "$line" ]&lt;BR /&gt; then&lt;BR /&gt;  echo $line&lt;BR /&gt; fi &lt;BR /&gt; line=$1" " ;;&lt;BR /&gt;*)&lt;BR /&gt; line=${line}$@ ;;&lt;BR /&gt;esac &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;while read a&lt;BR /&gt;do&lt;BR /&gt; txt3 $a&lt;BR /&gt;done&lt;BR /&gt;txt3&lt;BR /&gt;</description>
      <pubDate>Sun, 15 Sep 2002 14:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806437#M939726</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-09-15T14:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806438#M939727</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Some modifications (better handling of spaces).&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;txt3()&lt;BR /&gt;{&lt;BR /&gt;case "$#" in&lt;BR /&gt;0)&lt;BR /&gt; echo $line ;;&lt;BR /&gt;1)&lt;BR /&gt; if [ -n "$line" ]&lt;BR /&gt; then&lt;BR /&gt;  echo $line&lt;BR /&gt; fi &lt;BR /&gt; line=$1 ;;&lt;BR /&gt;*)&lt;BR /&gt; for b in $@&lt;BR /&gt; do&lt;BR /&gt;  line=${line}" "$b&lt;BR /&gt; done&lt;BR /&gt;esac &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;while read a&lt;BR /&gt;do&lt;BR /&gt; txt3 $a&lt;BR /&gt;done&lt;BR /&gt;txt3&lt;BR /&gt;</description>
      <pubDate>Sun, 15 Sep 2002 16:29:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806438#M939727</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-09-15T16:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806439#M939728</link>
      <description>Soji,&lt;BR /&gt;&lt;BR /&gt;If you don't mind using perl, here is a short one liner-&lt;BR /&gt;&lt;BR /&gt;perl -ne 'chomp; if (/^\d+$/) { print "\n",$a if $a; $a=$_; } else { $a.= " " . $_;&lt;BR /&gt;} print $a;' inputfile.txt&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 16 Sep 2002 02:33:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806439#M939728</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-09-16T02:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806440#M939729</link>
      <description>cat your_file|grep -v "#"|tr "\n" " "&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2002 02:46:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806440#M939729</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2002-09-16T02:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806441#M939730</link>
      <description>Hi Soji&lt;BR /&gt;&lt;BR /&gt;...using awk:&lt;BR /&gt;&lt;BR /&gt;awk '{if (NF==1 &amp;amp;&amp;amp; NR &amp;gt;1)printf("\n",$0)}{printf("%s",$0)}END{print}' file&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Mon, 16 Sep 2002 07:21:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806441#M939730</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-09-16T07:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help required</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806442#M939731</link>
      <description>Hi George,&lt;BR /&gt;&lt;BR /&gt;          maybe I read too much into your  question, but you could try running the attached script using your input file as par1.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K,&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Sep 2002 07:07:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-required/m-p/2806442#M939731</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2002-09-17T07:07:48Z</dc:date>
    </item>
  </channel>
</rss>

