<?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 add new line script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793226#M943706</link>
    <description>Hi Experts,&lt;BR /&gt;           Suppose if i have a file that contains 5 fields like :&lt;BR /&gt;&lt;BR /&gt;350  34  1  2.1  3.1&lt;BR /&gt;350  35  1  2.2  2.3&lt;BR /&gt;350  36  1  2.3  1.3&lt;BR /&gt;400  37  1  2.4  5.3&lt;BR /&gt;400  38  1  2.5  2.2&lt;BR /&gt;401  39  1  2.6  3.5&lt;BR /&gt;401  40  1  2.7  5.1&lt;BR /&gt;401  41  1  2.8  2.2&lt;BR /&gt;&lt;BR /&gt;And if i want to insert a blank line after every change in the first field for example in this case add a new line between 350 and 400 then 400 and 401 and so on for the whole file how do I do it. Either a one line awk or sed or a script ? Please help</description>
    <pubDate>Sat, 24 Aug 2002 05:01:42 GMT</pubDate>
    <dc:creator>george_57</dc:creator>
    <dc:date>2002-08-24T05:01:42Z</dc:date>
    <item>
      <title>add new line script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793226#M943706</link>
      <description>Hi Experts,&lt;BR /&gt;           Suppose if i have a file that contains 5 fields like :&lt;BR /&gt;&lt;BR /&gt;350  34  1  2.1  3.1&lt;BR /&gt;350  35  1  2.2  2.3&lt;BR /&gt;350  36  1  2.3  1.3&lt;BR /&gt;400  37  1  2.4  5.3&lt;BR /&gt;400  38  1  2.5  2.2&lt;BR /&gt;401  39  1  2.6  3.5&lt;BR /&gt;401  40  1  2.7  5.1&lt;BR /&gt;401  41  1  2.8  2.2&lt;BR /&gt;&lt;BR /&gt;And if i want to insert a blank line after every change in the first field for example in this case add a new line between 350 and 400 then 400 and 401 and so on for the whole file how do I do it. Either a one line awk or sed or a script ? Please help</description>
      <pubDate>Sat, 24 Aug 2002 05:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793226#M943706</guid>
      <dc:creator>george_57</dc:creator>
      <dc:date>2002-08-24T05:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: add new line script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793227#M943707</link>
      <description>Hi George,&lt;BR /&gt;&lt;BR /&gt;you can manage this with a simple script:&lt;BR /&gt;&lt;BR /&gt;for i in `cat input_file`&lt;BR /&gt;do&lt;BR /&gt;    echo "$i \n"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;---&amp;gt; echo " \n" will give an extra blank line after the original line....&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Sat, 24 Aug 2002 07:53:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793227#M943707</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-08-24T07:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: add new line script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793228#M943708</link>
      <description>Hi Pete,&lt;BR /&gt;       Thanks a lot for the response...but this didn't help...This gives a new line after every field. What i need is something like a blank line seperator after 3 records of 350, after 2 records of 400 and after 3 records of 401. i.e. After every change in the value of the first field. Please help...</description>
      <pubDate>Sat, 24 Aug 2002 08:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793228#M943708</guid>
      <dc:creator>george_57</dc:creator>
      <dc:date>2002-08-24T08:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: add new line script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793229#M943709</link>
      <description>Hi,&lt;BR /&gt;   you could try something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;PREVIOUS=""&lt;BR /&gt;&lt;BR /&gt;cat $1 | while read a b c d e&lt;BR /&gt;do&lt;BR /&gt;        if [ "$a" != "$PREVIOUS" ]&lt;BR /&gt;        then&lt;BR /&gt;                echo ""&lt;BR /&gt;        fi&lt;BR /&gt;        echo $a $b $c $d $e&lt;BR /&gt;        PREVIOUS=$a&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;John K.</description>
      <pubDate>Sat, 24 Aug 2002 09:08:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793229#M943709</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2002-08-24T09:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: add new line script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793230#M943710</link>
      <description>give this a try&lt;BR /&gt;cat yourfile | &lt;BR /&gt;awk 'BEGIN { x = $1;}&lt;BR /&gt;{&lt;BR /&gt;y=$1;&lt;BR /&gt;if ( y == x ) print $0;&lt;BR /&gt;else {&lt;BR /&gt;print "\n$0";&lt;BR /&gt;x=y;&lt;BR /&gt;}&lt;BR /&gt;}</description>
      <pubDate>Sat, 24 Aug 2002 09:08:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793230#M943710</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2002-08-24T09:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: add new line script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793231#M943711</link>
      <description>Thanks a lot guys...it worked great....</description>
      <pubDate>Sat, 24 Aug 2002 09:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-new-line-script/m-p/2793231#M943711</guid>
      <dc:creator>george_57</dc:creator>
      <dc:date>2002-08-24T09:33:00Z</dc:date>
    </item>
  </channel>
</rss>

