<?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 text lines. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572180#M873418</link>
    <description>Thank you all very much! Rita's awk worked for one record (which is ok for one of our files), and Clay's attachment worked for the file with many records (I have no idea what it really does, but YAY!)  Sorry, but the join command didn't seem to apply, and I didn't play much with the awk with the %3 stuff -- like I said I'm not competent in this stuff and need to closely analyze each of these solutions to see what they're really doing.  I appreciate all the input.</description>
    <pubDate>Wed, 29 Aug 2001 17:49:26 GMT</pubDate>
    <dc:creator>Evelyn Daroga</dc:creator>
    <dc:date>2001-08-29T17:49:26Z</dc:date>
    <item>
      <title>Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572175#M873413</link>
      <description>I have a text file which I need to read, and join 3 lines into a single record.  I know of several ways to do this.  The problems I am running into are:  (1) the 2nd and 3rd lines have leading spaces which must be preserved, and (2) the lines are of varying length, and I need them to be 132,131,80 respectively before joining them, so that the resulting records will have fixed-length fields.&lt;BR /&gt;&lt;BR /&gt;Using variable assignment drops the leading spaces on the 2nd and 3rd lines.&lt;BR /&gt;"pr -3tas " preserves the spaces and appends the lines, but doesn't address the varying line length problem.&lt;BR /&gt;&lt;BR /&gt;I've played with pr, printf, sed, awk, nroff, and who-knows-what-else.  I'm not very competent with most of these!&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be appreciated!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Aug 2001 14:44:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572175#M873413</guid>
      <dc:creator>Evelyn Daroga</dc:creator>
      <dc:date>2001-08-29T14:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572176#M873414</link>
      <description>Hi Evelyn,&lt;BR /&gt;&lt;BR /&gt;I may be misinterpreting your query, but, as a start, how about you do the following:&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;NR==1{printf("%-132s",$0)}&lt;BR /&gt;NR==2{printf("%-131s",$0)}&lt;BR /&gt;NR==3{printf("%-80s",$0)}&lt;BR /&gt;END{print}' filename&lt;BR /&gt;&lt;BR /&gt;I don't know how many lines are in your file, and how you're selecting the ones you want to join together.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 29 Aug 2001 15:13:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572176#M873414</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-08-29T15:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572177#M873415</link>
      <description>&lt;BR /&gt;Maybe the join command will help. See manpage for it.</description>
      <pubDate>Wed, 29 Aug 2001 15:26:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572177#M873415</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2001-08-29T15:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572178#M873416</link>
      <description>Hi&lt;BR /&gt;  If you have more than 3 lines you can do&lt;BR /&gt;&lt;BR /&gt;awk ' NR%3 == 0 { ... }&lt;BR /&gt;         NR%3 == 1 { ... }&lt;BR /&gt;         NR%3 == 2 { ... }' filename&lt;BR /&gt;&lt;BR /&gt;...BPK...&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Wed, 29 Aug 2001 16:03:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572178#M873416</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-08-29T16:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572179#M873417</link>
      <description>Hi Evelyn,&lt;BR /&gt;&lt;BR /&gt;This is rather easy with a 'here doc' script which calls awk. Use it like this:&lt;BR /&gt;&lt;BR /&gt;3lines.sh &amp;lt; my_input_file &amp;gt; my_output_file&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Wed, 29 Aug 2001 16:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572179#M873417</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-29T16:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572180#M873418</link>
      <description>Thank you all very much! Rita's awk worked for one record (which is ok for one of our files), and Clay's attachment worked for the file with many records (I have no idea what it really does, but YAY!)  Sorry, but the join command didn't seem to apply, and I didn't play much with the awk with the %3 stuff -- like I said I'm not competent in this stuff and need to closely analyze each of these solutions to see what they're really doing.  I appreciate all the input.</description>
      <pubDate>Wed, 29 Aug 2001 17:49:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572180#M873418</guid>
      <dc:creator>Evelyn Daroga</dc:creator>
      <dc:date>2001-08-29T17:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Joining text lines.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572181#M873419</link>
      <description>OOPS... I meant Robin's solution... Not "Rita's".  Sorry, Robin!</description>
      <pubDate>Wed, 29 Aug 2001 17:51:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/joining-text-lines/m-p/2572181#M873419</guid>
      <dc:creator>Evelyn Daroga</dc:creator>
      <dc:date>2001-08-29T17:51:20Z</dc:date>
    </item>
  </channel>
</rss>

