<?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 Insert blank line in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821507#M940153</link>
    <description>Hi Experts, &lt;BR /&gt;      Im trying to read a text file with 5 fields and insert a blank line after every two records or lines. Could somebody help me with a script to do read the file and insert a blank line after reading every 2 lines?</description>
    <pubDate>Wed, 09 Oct 2002 04:52:49 GMT</pubDate>
    <dc:creator>george_57</dc:creator>
    <dc:date>2002-10-09T04:52:49Z</dc:date>
    <item>
      <title>Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821507#M940153</link>
      <description>Hi Experts, &lt;BR /&gt;      Im trying to read a text file with 5 fields and insert a blank line after every two records or lines. Could somebody help me with a script to do read the file and insert a blank line after reading every 2 lines?</description>
      <pubDate>Wed, 09 Oct 2002 04:52:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821507#M940153</guid>
      <dc:creator>george_57</dc:creator>
      <dc:date>2002-10-09T04:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821508#M940154</link>
      <description>Hi george&lt;BR /&gt;&lt;BR /&gt;awk '{line[NR]=$0}&lt;BR /&gt;     END {&lt;BR /&gt;       for ( i=1;i&amp;lt;=NR;i++)&lt;BR /&gt;         { print line[i]; if ( i%2 == 0 ) print}&lt;BR /&gt;     }' textfile&lt;BR /&gt;&lt;BR /&gt;textfile like this:&lt;BR /&gt;&lt;BR /&gt;a1 a2 a3 a4 a5&lt;BR /&gt;b1 b2 b3 b4 b5&lt;BR /&gt;c1 c2 c3 c4 c5&lt;BR /&gt;d1 d2 d3 d4 d5&lt;BR /&gt;e1 e2 e3 e4 e5&lt;BR /&gt;f1 f2 f3 f4 f5&lt;BR /&gt;&lt;BR /&gt;results in &lt;BR /&gt;&lt;BR /&gt;a1 a2 a3 a4 a5&lt;BR /&gt;b1 b2 b3 b4 b5&lt;BR /&gt; &lt;BR /&gt;c1 c2 c3 c4 c5&lt;BR /&gt;d1 d2 d3 d4 d5&lt;BR /&gt; &lt;BR /&gt;e1 e2 e3 e4 e5&lt;BR /&gt;f1 f2 f3 f4 f5&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 09 Oct 2002 05:24:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821508#M940154</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-10-09T05:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821509#M940155</link>
      <description>Hi George,&lt;BR /&gt;this should do what you want:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# insert blank after CH_NUMBER of lines&lt;BR /&gt;CH_NUMBER=2&lt;BR /&gt;NUMBER=0&lt;BR /&gt;cat $1 | while read line&lt;BR /&gt;do&lt;BR /&gt;        if [ $NUMBER -eq $CH_NUMBER ]&lt;BR /&gt;        then&lt;BR /&gt;                echo ""&lt;BR /&gt;                NUMBER=0&lt;BR /&gt;        fi&lt;BR /&gt;        let NUMBER="$NUMBER + 1"&lt;BR /&gt;        echo $line&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Wed, 09 Oct 2002 06:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821509#M940155</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2002-10-09T06:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821510#M940156</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Another awk solution:&lt;BR /&gt;&lt;BR /&gt;awk '{ getline a ; getline b ; print a",\n",b,"\n"}' &lt;DATAFILE&gt;&lt;/DATAFILE&gt;</description>
      <pubDate>Wed, 09 Oct 2002 07:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821510#M940156</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-10-09T07:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821511#M940157</link>
      <description>Hi George:&lt;BR /&gt;&lt;BR /&gt;Another:&lt;BR /&gt;&lt;BR /&gt;# awk '{if (NR%2==1) {print $0} else {print $0"\n"}}' filename&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 09 Oct 2002 09:45:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821511#M940157</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-10-09T09:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821512#M940158</link>
      <description>Hi George&lt;BR /&gt;&lt;BR /&gt;# add a blank line every 2 lines (after lines 2,4,6 etc.)&lt;BR /&gt;gsed '0~5G'    # GNU sed only&lt;BR /&gt;sed 'n;G;' # other seds&lt;BR /&gt;&lt;BR /&gt;sed 'n;G;' test &amp;gt; test1&lt;BR /&gt;&lt;BR /&gt;Now test1 has blank line after ever 2 lines.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Wed, 09 Oct 2002 12:14:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821512#M940158</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-10-09T12:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821513#M940159</link>
      <description>&lt;BR /&gt;This PERL gem works ($. is the input line #):&lt;BR /&gt;&lt;BR /&gt;perl -ne 'print; print "\n" if $.%2==0;' file0 &amp;gt; file1&lt;BR /&gt;&lt;BR /&gt;This following does NOT work because it prints the input line after the code snippit is processed:&lt;BR /&gt;&lt;BR /&gt;perl -pe 'print "\n" if $.%2==0;' file0 &amp;lt; file1&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Oct 2002 15:07:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821513#M940159</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-09T15:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Insert blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821514#M940160</link>
      <description>&lt;BR /&gt;A little more terse:&lt;BR /&gt;&lt;BR /&gt;perl -ne 'print $_,($.%2)?undef:"\n";' &lt;INFILE&gt;outfile&lt;BR /&gt;&lt;BR /&gt;&lt;/INFILE&gt;</description>
      <pubDate>Thu, 10 Oct 2002 06:50:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-blank-line/m-p/2821514#M940160</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-10T06:50:28Z</dc:date>
    </item>
  </channel>
</rss>

