<?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: script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266313#M888775</link>
    <description>There'll undoutably be good perl solutions soon, but here's a quick 'awk' solution:&lt;BR /&gt;&lt;BR /&gt;awk -F':' '/^#/ { print } { if (NF == 1) { HEADER=$1; next;} ; printf( "%s:%s\n", HEADER, $0 ); }' &amp;lt; InputFile</description>
    <pubDate>Tue, 04 May 2004 01:23:39 GMT</pubDate>
    <dc:creator>Stuart Browne</dc:creator>
    <dc:date>2004-05-04T01:23:39Z</dc:date>
    <item>
      <title>script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266312#M888774</link>
      <description>Hi,&lt;BR /&gt;I've an input file with the following details:&lt;BR /&gt;&lt;BR /&gt;SERVER1&lt;BR /&gt;AAAA:11111:BLAH BLAH:BLAH&lt;BR /&gt;bbbb:11111:BLAH BLAH:BLAH&lt;BR /&gt;#--------------------------#&lt;BR /&gt;SERVER2&lt;BR /&gt;STUFF:STUFF2:11111:TEST&lt;BR /&gt;#--------------------------#&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;and so on ...&lt;BR /&gt;&lt;BR /&gt;I want to append or prepend the lines without colon (those are the lines with server1, server2 values) to the lines that follow those values (the lines with colon)&lt;BR /&gt;so that my output will look something like this ....&lt;BR /&gt;&lt;BR /&gt;SERVER1:AAAA:11111:BLAH BLAH:BLAH&lt;BR /&gt;SERVER1:bbbb:11111:BLAH BLAH:BLAH&lt;BR /&gt;#--------------------------------#&lt;BR /&gt;SERVER2:STUFF:STUFF2:11111:TEST&lt;BR /&gt;#--------------------------------#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;How do I go about doing this ?&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Tue, 04 May 2004 00:26:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266312#M888774</guid>
      <dc:creator>Shabu Khan_1</dc:creator>
      <dc:date>2004-05-04T00:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266313#M888775</link>
      <description>There'll undoutably be good perl solutions soon, but here's a quick 'awk' solution:&lt;BR /&gt;&lt;BR /&gt;awk -F':' '/^#/ { print } { if (NF == 1) { HEADER=$1; next;} ; printf( "%s:%s\n", HEADER, $0 ); }' &amp;lt; InputFile</description>
      <pubDate>Tue, 04 May 2004 01:23:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266313#M888775</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-05-04T01:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266314#M888776</link>
      <description>Thanks Stuart !&lt;BR /&gt;&lt;BR /&gt;That was pretty neat ...&lt;BR /&gt;&lt;BR /&gt;-Shabu</description>
      <pubDate>Tue, 04 May 2004 01:29:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266314#M888776</guid>
      <dc:creator>Shabu Khan_1</dc:creator>
      <dc:date>2004-05-04T01:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266315#M888777</link>
      <description>a perl version...&lt;BR /&gt;&lt;BR /&gt;$file="&lt;FILE&gt;&lt;/FILE&gt;open(file);&lt;BR /&gt;while(&lt;FILE&gt;) {&lt;BR /&gt;  chomp;&lt;BR /&gt;  ~ m/:/g;&lt;BR /&gt;  if (pos) { print "$header:$_\n"; }&lt;BR /&gt;  else { $header=$_; }&lt;BR /&gt;}&lt;BR /&gt;close(file);&lt;BR /&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 04 May 2004 02:37:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3266315#M888777</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-05-04T02:37:50Z</dc:date>
    </item>
  </channel>
</rss>

