<?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 Merging file lines in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450227#M852489</link>
    <description>I have file which has a blank line in every 4 lines. I wnat to merge all lines come before the the blank.&lt;BR /&gt;ex:&lt;BR /&gt;&lt;BR /&gt;My name is sam&lt;BR /&gt;her name is judy&lt;BR /&gt;his name is blabla&lt;BR /&gt;its name is cat&lt;BR /&gt;&lt;BR /&gt;My name is sam&lt;BR /&gt;her name is judy&lt;BR /&gt;his name is blabla&lt;BR /&gt;its name is cat&lt;BR /&gt;&lt;BR /&gt;I want the result to be:&lt;BR /&gt;My name is sam:her name is judy:his name is blabla:its name is cat&lt;BR /&gt;My name is sam:her name is judy:his name is blabla:its name is cat&lt;BR /&gt;&lt;BR /&gt;Please help urgent&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 24 Dec 2004 23:41:31 GMT</pubDate>
    <dc:creator>Abdullatif M. Abdulla</dc:creator>
    <dc:date>2004-12-24T23:41:31Z</dc:date>
    <item>
      <title>Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450227#M852489</link>
      <description>I have file which has a blank line in every 4 lines. I wnat to merge all lines come before the the blank.&lt;BR /&gt;ex:&lt;BR /&gt;&lt;BR /&gt;My name is sam&lt;BR /&gt;her name is judy&lt;BR /&gt;his name is blabla&lt;BR /&gt;its name is cat&lt;BR /&gt;&lt;BR /&gt;My name is sam&lt;BR /&gt;her name is judy&lt;BR /&gt;his name is blabla&lt;BR /&gt;its name is cat&lt;BR /&gt;&lt;BR /&gt;I want the result to be:&lt;BR /&gt;My name is sam:her name is judy:his name is blabla:its name is cat&lt;BR /&gt;My name is sam:her name is judy:his name is blabla:its name is cat&lt;BR /&gt;&lt;BR /&gt;Please help urgent&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Dec 2004 23:41:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450227#M852489</guid>
      <dc:creator>Abdullatif M. Abdulla</dc:creator>
      <dc:date>2004-12-24T23:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450228#M852490</link>
      <description>Hi,&lt;BR /&gt;I don't know why u have this in your profile:&lt;BR /&gt;&lt;BR /&gt;"I have assigned points to   0  of   64  responses to my questions"&lt;BR /&gt;&lt;BR /&gt;Go thr' this link below:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?admit=716493758+1085211538437+28353475#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?admit=716493758+1085211538437+28353475#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope that helps.&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 25 Dec 2004 00:34:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450228#M852490</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-12-25T00:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450229#M852491</link>
      <description>Hi Mr katkar&lt;BR /&gt;&lt;BR /&gt;I couldnt follow please explain more</description>
      <pubDate>Sat, 25 Dec 2004 00:50:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450229#M852491</guid>
      <dc:creator>Abdullatif M. Abdulla</dc:creator>
      <dc:date>2004-12-25T00:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450230#M852492</link>
      <description>Helps in the sense of what?&lt;BR /&gt;&lt;BR /&gt;Is this forum for fooling or what?&lt;BR /&gt;&lt;BR /&gt;Keep your nose away if you dont have any answer?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Sat, 25 Dec 2004 04:38:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450230#M852492</guid>
      <dc:creator>Abdullatif M. Abdulla</dc:creator>
      <dc:date>2004-12-25T04:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450231#M852493</link>
      <description>He tried to tell You that in using a free service You are somewhat asked to behave by it's rules. &lt;BR /&gt;&lt;BR /&gt;You don't, and I guess that's why he gave You no answer. (And I agree on that)&lt;BR /&gt;&lt;BR /&gt;I myself don't know the short and professional regex - based way, but You could also do something like&lt;BR /&gt;&lt;BR /&gt;script.ksh &amp;lt; input&lt;BR /&gt;&lt;BR /&gt;with script.ksh like&lt;BR /&gt;&lt;BR /&gt;while read content&lt;BR /&gt;do&lt;BR /&gt;#set -x&lt;BR /&gt;if [ "X$content" = "X" ]&lt;BR /&gt; then&lt;BR /&gt;  echo $result&lt;BR /&gt;  unset result&lt;BR /&gt; else&lt;BR /&gt;  result="${result}:${content}"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;addionally learn to say thanks, unless You really enjoy people being unwilling to help You.&lt;BR /&gt;</description>
      <pubDate>Sat, 25 Dec 2004 20:40:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450231#M852493</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2004-12-25T20:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450232#M852494</link>
      <description>Thanks Heigl&lt;BR /&gt;&lt;BR /&gt;I appreciate your help, but i found better answer in sed $ awk nutshell book already.&lt;BR /&gt;&lt;BR /&gt;I have never had the manner of not thanking people who helped me.But, it disturbs me to feel that some one is pretending to be smart like  Katkat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sat, 25 Dec 2004 23:21:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450232#M852494</guid>
      <dc:creator>Abdullatif M. Abdulla</dc:creator>
      <dc:date>2004-12-25T23:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450233#M852495</link>
      <description>Hello Mr.Abdullatif,&lt;BR /&gt;&lt;BR /&gt;Good to know you got your answer. &lt;BR /&gt;&lt;BR /&gt;Please cool down, as the text do not portray the real expressions the writer had. There was no wrong intention in that post.&lt;BR /&gt;&lt;BR /&gt;Please do call me on my mobile 050-4683550 if you need to talk to me. The Forum is to help each other anyway.&lt;BR /&gt;&lt;BR /&gt;With regards,&lt;BR /&gt;Mohan&lt;BR /&gt;Emitac.</description>
      <pubDate>Sun, 26 Dec 2004 04:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450233#M852495</guid>
      <dc:creator>Mohanasundaram_1</dc:creator>
      <dc:date>2004-12-26T04:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450234#M852496</link>
      <description>You can do as,&lt;BR /&gt;&lt;BR /&gt; muthu # cat junk&lt;BR /&gt;My name is sam&lt;BR /&gt;her name is judy&lt;BR /&gt;his name is blabla&lt;BR /&gt;its name is cat&lt;BR /&gt;&lt;BR /&gt;My name is sam&lt;BR /&gt;her name is judy&lt;BR /&gt;his name is blabla&lt;BR /&gt;its name is cat&lt;BR /&gt; muthu # awk '!/^$/ { print $0 }' junk | awk '{ if ( NR % 4 != 0) {printf $0":" } else {printf $0"\n"} }'&lt;BR /&gt;My name is sam:her name is judy:his name is blabla:its name is cat&lt;BR /&gt;My name is sam:her name is judy:his name is blabla:its name is cat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk is useful to do this effectively.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 27 Dec 2004 00:16:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450234#M852496</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-12-27T00:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450235#M852497</link>
      <description>Hello Mr.Abdullatif,&lt;BR /&gt;&lt;BR /&gt;I realize you have thanked helpers before as you have indeed thanked me: &lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=753008" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=753008&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;However, this is not immediately obvious to all.&lt;BR /&gt;You may want to consider just going with the flow and use the 'points' system to indicated how helpful/useful a particular reply was. It is short and concise, and does not 'waste' bandwith by bringing topic back to the top. It helps some (like me) to decide whether to go into a 'still open' topic. An explicit thank-you remains welcome of course in a 'closing' reply where you, as the author,  mark the entire topic as 'done'.&lt;BR /&gt;&lt;BR /&gt;Also, for the curious folks amongst us, you may want to indicate your final solution (for our education), and/or problems with prior solution (like Heigl's script having a leading ":").&lt;BR /&gt;&lt;BR /&gt;fwiw... I'd solve it in perl.&lt;BR /&gt;If a trailing ":" is acceptable:&lt;BR /&gt;&lt;BR /&gt;perl -pe 'chop; $_ .= (/^$/)? "\n" : ":"' input&lt;BR /&gt;&lt;BR /&gt;-p = loop and print $_ at end of loop&lt;BR /&gt;chop = take of last character from $_ (newline)&lt;BR /&gt;$_ .=  = append the following to $_&lt;BR /&gt;($/^$) = empty line?&lt;BR /&gt;? "\n" = if empty add a newline&lt;BR /&gt;: ":" = if not then add a colon&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As specified:&lt;BR /&gt;&lt;BR /&gt;perl -ne 'if (/^$/){chop $line; print "$line\n"; $line=""} else {chop; $line .= $_ . ":"} ' input&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Dec 2004 00:16:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450235#M852497</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-12-27T00:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450236#M852498</link>
      <description>Mr. Abdulla,&lt;BR /&gt;It was for your betterment i gave you that advice and honestly i was not able to answer your tricky question in limited time i had and i was curious about the replies that will be coming up. &lt;BR /&gt;Now when you go on inetractive by assigning points and making others realize the depth of thier solution they can further help you better. &lt;BR /&gt;There was nothing sarcastic in by reply which made you so irritating. Well, it happens when person is in problem start doubting everybody and in negative way.&lt;BR /&gt;&lt;BR /&gt;My intention was to speed up the responses to your question thereby getting you quick help.&lt;BR /&gt;&lt;BR /&gt;1. "Helps in the sense of what?&lt;BR /&gt;&lt;BR /&gt;Is this forum for fooling or what?&lt;BR /&gt;&lt;BR /&gt;Keep your nose away if you dont have any answer? "&lt;BR /&gt;&lt;BR /&gt;Ans.. I had already kept my nose out because i know my limits and depth of knowledge. Secondly even if i was wrong or i had misbehaved how can you directly blame the entire forum that shows how week you are in concluding things.&lt;BR /&gt;&lt;BR /&gt;2. "I have never had the manner of not thanking people who helped me.But, it disturbs me to feel that some one is pretending to be smart like Katkar."&lt;BR /&gt;&lt;BR /&gt;Ans.. DOn't get disturb without knowing the facts and for the later part i have already told you how fast and wrong you are in your conclusion.&lt;BR /&gt;&lt;BR /&gt;I am helpless if you are not able to understand my intentions.&lt;BR /&gt;&lt;BR /&gt;I wish you all the best.&lt;BR /&gt;Bharat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Dec 2004 01:38:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450236#M852498</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-12-27T01:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merging file lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450237#M852499</link>
      <description>Abdulla,&lt;BR /&gt;GO thr' this thread below :&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=553711" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=553711&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Bharat had actively helped you there and it's unfortunate see your comments in this thread. He tried to help you out there and you even didn't care to give any feedback on it, forget about assiging points ( it's not at all compulsory) &lt;BR /&gt;Girish....</description>
      <pubDate>Mon, 27 Dec 2004 02:08:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/merging-file-lines/m-p/3450237#M852499</guid>
      <dc:creator>Girish_17</dc:creator>
      <dc:date>2004-12-27T02:08:01Z</dc:date>
    </item>
  </channel>
</rss>

