<?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: joining consecutive lines in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735102#M836873</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Below works on the assumption that "xx patternA" can itself be a static pattern. Apart from that, no problems getting everything from patternA to patternB to be on a the same line:&lt;BR /&gt;&lt;BR /&gt;bash-2.05a# cat tstfile&lt;BR /&gt;xxxxx &lt;BR /&gt;xx patternA xx &lt;BR /&gt;patternB &lt;BR /&gt;xxxxx &lt;BR /&gt;xx patternA xx &lt;BR /&gt;xxxxx &lt;BR /&gt;patternB &lt;BR /&gt;xxxxx &lt;BR /&gt;&lt;BR /&gt;bash-2.05a# echo `cat tstfile` | sed "s/ xx patternA/;xx patternA/g" | sed "s/patternB /patternB;/g" | tr [";"] ["\n"]&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx xxxxx patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
    <pubDate>Fri, 31 May 2002 09:18:41 GMT</pubDate>
    <dc:creator>Steven Sim Kok Leong</dc:creator>
    <dc:date>2002-05-31T09:18:41Z</dc:date>
    <item>
      <title>joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735095#M836866</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have file which looks like :&lt;BR /&gt;xxxxxxxxxx&lt;BR /&gt;xxx pattern xxx&lt;BR /&gt;yyy&lt;BR /&gt;xxx pattern xxx&lt;BR /&gt;yyy&lt;BR /&gt;xxxxxxxx&lt;BR /&gt;&lt;BR /&gt;I would like to join consecutive lines so the output looks like :&lt;BR /&gt;&lt;BR /&gt;xxxxxxxxxx&lt;BR /&gt;xxx pattern xxxyyy&lt;BR /&gt;xxx pattern xxxyyy&lt;BR /&gt;xxxxxxxx&lt;BR /&gt;&lt;BR /&gt;How can this be realised with a simple sed or awk statement ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Franky</description>
      <pubDate>Fri, 31 May 2002 06:33:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735095#M836866</guid>
      <dc:creator>Franky Leeuwerck</dc:creator>
      <dc:date>2002-05-31T06:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735096#M836867</link>
      <description>Meanwhile I found a solution myself here it is.&lt;BR /&gt;&lt;BR /&gt;sed '/pattern/N;s/\n/ /' filename&lt;BR /&gt;&lt;BR /&gt;This will join only the lines with the pattern.&lt;BR /&gt;&lt;BR /&gt;Thanks anyway.&lt;BR /&gt;&lt;BR /&gt;Franky</description>
      <pubDate>Fri, 31 May 2002 06:40:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735096#M836867</guid>
      <dc:creator>Franky Leeuwerck</dc:creator>
      <dc:date>2002-05-31T06:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735097#M836868</link>
      <description>Hi Franky,&lt;BR /&gt;&lt;BR /&gt;you forgot to assign points to yourself for the quick solution of your problem....&lt;BR /&gt;&lt;BR /&gt;:-)&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Fri, 31 May 2002 06:42:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735097#M836868</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-05-31T06:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735098#M836869</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;Unfortunately you can not assign points  for your own solutions.  If that would have succeeded, then that would be my first points to be honest.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Franky</description>
      <pubDate>Fri, 31 May 2002 06:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735098#M836869</guid>
      <dc:creator>Franky Leeuwerck</dc:creator>
      <dc:date>2002-05-31T06:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735099#M836870</link>
      <description>Give your opinion about my T-Shirt design, and I'll give you your first forum points. Deal?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3b617bb04b5cd611abdb0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3b617bb04b5cd611abdb0090277a778c,00.html&lt;/A&gt;</description>
      <pubDate>Fri, 31 May 2002 07:53:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735099#M836870</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-31T07:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735100#M836871</link>
      <description>Sorry, the solution was found too soon.&lt;BR /&gt;&lt;BR /&gt;Seems that the problem is a bit more complicated. It is sometimes necessary to join 3 or more lines.&lt;BR /&gt;&lt;BR /&gt;Suppose the file looks like :&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx&lt;BR /&gt;patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx&lt;BR /&gt;xxxxx&lt;BR /&gt;patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;&lt;BR /&gt;The result file should like like :&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xxpatternB&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xxxxxxxpatternB&lt;BR /&gt;xxxxx&lt;BR /&gt;&lt;BR /&gt;Any suggestions,&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Franky&lt;BR /&gt;</description>
      <pubDate>Fri, 31 May 2002 08:33:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735100#M836871</guid>
      <dc:creator>Franky Leeuwerck</dc:creator>
      <dc:date>2002-05-31T08:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735101#M836872</link>
      <description>Well,&lt;BR /&gt;&lt;BR /&gt;I found the solution for the real problem, not on my last question :&lt;BR /&gt;&lt;BR /&gt;cat file.org | sed -e '/startpattern/,/endpattern$/ d' &amp;gt; file.new&lt;BR /&gt;&lt;BR /&gt;This will delete every block (multiple consecutive lines ) in the file starting with a line containing the startpattern and ending with a line ending with the endpattern.&lt;BR /&gt;&lt;BR /&gt;Thanks anyway.</description>
      <pubDate>Fri, 31 May 2002 09:11:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735101#M836872</guid>
      <dc:creator>Franky Leeuwerck</dc:creator>
      <dc:date>2002-05-31T09:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735102#M836873</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Below works on the assumption that "xx patternA" can itself be a static pattern. Apart from that, no problems getting everything from patternA to patternB to be on a the same line:&lt;BR /&gt;&lt;BR /&gt;bash-2.05a# cat tstfile&lt;BR /&gt;xxxxx &lt;BR /&gt;xx patternA xx &lt;BR /&gt;patternB &lt;BR /&gt;xxxxx &lt;BR /&gt;xx patternA xx &lt;BR /&gt;xxxxx &lt;BR /&gt;patternB &lt;BR /&gt;xxxxx &lt;BR /&gt;&lt;BR /&gt;bash-2.05a# echo `cat tstfile` | sed "s/ xx patternA/;xx patternA/g" | sed "s/patternB /patternB;/g" | tr [";"] ["\n"]&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx xxxxx patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Fri, 31 May 2002 09:18:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735102#M836873</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-05-31T09:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: joining consecutive lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735103#M836874</link>
      <description>Is it possible to reverse the problem?&lt;BR /&gt;&lt;BR /&gt;Suppose the file looks like :&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx&lt;BR /&gt;patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx&lt;BR /&gt;xxxxx&lt;BR /&gt;patternB&lt;BR /&gt;xxxxx&lt;BR /&gt;&lt;BR /&gt;The result file should like like :&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xxpatternB&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xxxxxxxpatternB&lt;BR /&gt;xxxxx&lt;BR /&gt;&lt;BR /&gt;# perl -pe 'BEGIN{$/="xxxxx\n"}chomp;s/\n/ /g;$_.=$/' xx.txt&lt;BR /&gt;xxxxx&lt;BR /&gt;xx patternA xx patternB xxxxx&lt;BR /&gt;xx patternA xx xxxxx&lt;BR /&gt;patternB xxxxx&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 31 May 2002 09:58:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-consecutive-lines/m-p/2735103#M836874</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-31T09:58:19Z</dc:date>
    </item>
  </channel>
</rss>

