<?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: Easy Script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936754#M102557</link>
    <description>&lt;BR /&gt;Paste is probably the way to go.&lt;BR /&gt;&lt;BR /&gt;To produce EXACTLY the requested result just add /dev/null as a final file to force the final seperator.&lt;BR /&gt;&lt;BR /&gt;$ paste -d : file* /dev/null&lt;BR /&gt;xxxx11111:c:abcd1234:&lt;BR /&gt;xxxx11111:d:asdfjkl;:&lt;BR /&gt;bbbb22222:a::&lt;BR /&gt;&lt;BR /&gt;If you need more elaborate logic in the paste operation (dealing with empty lines?), then you may want to script it, perhaps in perl. For example:&lt;BR /&gt;&lt;BR /&gt;-------- paste.p --------&lt;BR /&gt;$sep = shift @ARGV;&lt;BR /&gt;while (&lt;SHIFT&gt;) {&lt;BR /&gt; $i=0;&lt;BR /&gt; open F,"&amp;lt;$_";&lt;BR /&gt; while (&lt;F&gt;){&lt;BR /&gt;  chop;&lt;BR /&gt;  @lines[$i++] .= $_ . $sep;&lt;BR /&gt;  }&lt;BR /&gt; @lines[$i++] .= $sep while ($i &amp;lt; $m);&lt;BR /&gt; $m = $i;&lt;BR /&gt;}&lt;BR /&gt;print "$_\n" foreach @lines;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;----------- sample usage ----------&lt;BR /&gt;&lt;BR /&gt;$ perl paste.p : file*&lt;BR /&gt;xxxx11111:c:abcd1234:&lt;BR /&gt;xxxx11111:d:asdfjkl;:&lt;BR /&gt;bbbb22222:a::&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;/F&gt;&lt;/SHIFT&gt;</description>
    <pubDate>Wed, 26 Oct 2005 20:32:57 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2005-10-26T20:32:57Z</dc:date>
    <item>
      <title>Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936751#M102554</link>
      <description>I just can't get it.  I have 21 files and each has one field.  I want to combine all the files into one with all the fields matching on each line separated by a :&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;file1.&lt;BR /&gt;xxxx11111&lt;BR /&gt;xxxx11111&lt;BR /&gt;bbbb22222&lt;BR /&gt;&lt;BR /&gt;file2.&lt;BR /&gt;c&lt;BR /&gt;d&lt;BR /&gt;a&lt;BR /&gt;&lt;BR /&gt;file3.&lt;BR /&gt;abcd1234&lt;BR /&gt;asdfjkl;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The file I want:&lt;BR /&gt;xxxx1111:c:abcd1234:&lt;BR /&gt;xxxx1111:d:asdfjkl;:&lt;BR /&gt;bbbb2222:a::&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;How can I combine the files?????&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;jcd...&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Oct 2005 16:28:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936751#M102554</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2005-10-26T16:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936752#M102555</link>
      <description>Easy&lt;BR /&gt;&lt;BR /&gt;paste -d : file1 file2 ... filen &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;Man paste for details.</description>
      <pubDate>Wed, 26 Oct 2005 16:32:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936752#M102555</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-10-26T16:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936753#M102556</link>
      <description>Hi Joesph:&lt;BR /&gt;&lt;BR /&gt;# paste -d ":" file1 file2 file3 ...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 26 Oct 2005 16:33:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936753#M102556</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-10-26T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936754#M102557</link>
      <description>&lt;BR /&gt;Paste is probably the way to go.&lt;BR /&gt;&lt;BR /&gt;To produce EXACTLY the requested result just add /dev/null as a final file to force the final seperator.&lt;BR /&gt;&lt;BR /&gt;$ paste -d : file* /dev/null&lt;BR /&gt;xxxx11111:c:abcd1234:&lt;BR /&gt;xxxx11111:d:asdfjkl;:&lt;BR /&gt;bbbb22222:a::&lt;BR /&gt;&lt;BR /&gt;If you need more elaborate logic in the paste operation (dealing with empty lines?), then you may want to script it, perhaps in perl. For example:&lt;BR /&gt;&lt;BR /&gt;-------- paste.p --------&lt;BR /&gt;$sep = shift @ARGV;&lt;BR /&gt;while (&lt;SHIFT&gt;) {&lt;BR /&gt; $i=0;&lt;BR /&gt; open F,"&amp;lt;$_";&lt;BR /&gt; while (&lt;F&gt;){&lt;BR /&gt;  chop;&lt;BR /&gt;  @lines[$i++] .= $_ . $sep;&lt;BR /&gt;  }&lt;BR /&gt; @lines[$i++] .= $sep while ($i &amp;lt; $m);&lt;BR /&gt; $m = $i;&lt;BR /&gt;}&lt;BR /&gt;print "$_\n" foreach @lines;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;----------- sample usage ----------&lt;BR /&gt;&lt;BR /&gt;$ perl paste.p : file*&lt;BR /&gt;xxxx11111:c:abcd1234:&lt;BR /&gt;xxxx11111:d:asdfjkl;:&lt;BR /&gt;bbbb22222:a::&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;/F&gt;&lt;/SHIFT&gt;</description>
      <pubDate>Wed, 26 Oct 2005 20:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936754#M102557</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-10-26T20:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936755#M102558</link>
      <description>pr -ms: -t file*&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;pr -ms: -t file1 file2 file3 ... filen&lt;BR /&gt;&lt;BR /&gt;will do it.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Thu, 27 Oct 2005 01:28:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936755#M102558</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-27T01:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936756#M102559</link>
      <description>Thanks folks.  Ya'll are the best!!!  I guess that is why all the head gear!@#$%&amp;amp;*(&lt;BR /&gt;&lt;BR /&gt;Thanks Again,&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Tue, 01 Nov 2005 12:18:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936756#M102559</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2005-11-01T12:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Easy Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936757#M102560</link>
      <description>Thread Closed.  Solutions above.</description>
      <pubDate>Tue, 01 Nov 2005 12:19:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/easy-script/m-p/4936757#M102560</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2005-11-01T12:19:18Z</dc:date>
    </item>
  </channel>
</rss>

