<?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 PERL script help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733287#M101075</link>
    <description>I am once again found wanting in my scripting skills.&lt;BR /&gt;&lt;BR /&gt;I have few files which have data like&lt;BR /&gt;&lt;BR /&gt;tran_type tran_num Suc failure percentage&lt;BR /&gt;&lt;BR /&gt;abc         11      10  5        50&lt;BR /&gt;def         12      10  0        100&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;there are around 10 to 15 files like this.&lt;BR /&gt;&lt;BR /&gt;I need to write a script that would read all the files and combine the data together and generate a single output file containing the summation of all the tran type and number.&lt;BR /&gt;&lt;BR /&gt;Can anyone please help.&lt;BR /&gt;&lt;BR /&gt;-Pat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 16 Feb 2006 14:33:25 GMT</pubDate>
    <dc:creator>Pat Peter</dc:creator>
    <dc:date>2006-02-16T14:33:25Z</dc:date>
    <item>
      <title>PERL script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733287#M101075</link>
      <description>I am once again found wanting in my scripting skills.&lt;BR /&gt;&lt;BR /&gt;I have few files which have data like&lt;BR /&gt;&lt;BR /&gt;tran_type tran_num Suc failure percentage&lt;BR /&gt;&lt;BR /&gt;abc         11      10  5        50&lt;BR /&gt;def         12      10  0        100&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;there are around 10 to 15 files like this.&lt;BR /&gt;&lt;BR /&gt;I need to write a script that would read all the files and combine the data together and generate a single output file containing the summation of all the tran type and number.&lt;BR /&gt;&lt;BR /&gt;Can anyone please help.&lt;BR /&gt;&lt;BR /&gt;-Pat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2006 14:33:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733287#M101075</guid>
      <dc:creator>Pat Peter</dc:creator>
      <dc:date>2006-02-16T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: PERL script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733288#M101076</link>
      <description>Hi Pat:&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# cat perl.pl&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my ($key, $count);&lt;BR /&gt;my  %data;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    ($key,$count) =  split;&lt;BR /&gt;    $data{$key}   += $count;&lt;BR /&gt;}&lt;BR /&gt;foreach $key (sort keys %data) {&lt;BR /&gt;    print "$key $data{$key}\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Run as:&lt;BR /&gt;&lt;BR /&gt;./perl.pl file1 file2 file3 ...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 16 Feb 2006 14:46:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733288#M101076</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-16T14:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: PERL script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733289#M101077</link>
      <description>And of course you'd extent that to the other fields:&lt;BR /&gt;&lt;BR /&gt;($key,$count,$suc,$fail) = split;&lt;BR /&gt;$data{$key} += $count;&lt;BR /&gt;$suc{$key} += $suc;&lt;BR /&gt;:, because you woudl have to do a weighted calc.&lt;BR /&gt;Just recalculate if needed after reading all.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2006 14:56:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733289#M101077</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-02-16T14:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: PERL script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733290#M101078</link>
      <description>[ooop, wrong button. Moderator, please delete prior reply]&lt;BR /&gt;&lt;BR /&gt;And of course you'd extent that to the other fields:&lt;BR /&gt;&lt;BR /&gt;($key,$count,$suc,$fail) = split;&lt;BR /&gt;$data{$key} += $count;&lt;BR /&gt;$suc{$key} += $suc;&lt;BR /&gt;:&lt;BR /&gt;print ... $suc{$key}...&lt;BR /&gt;&lt;BR /&gt;I woudl not add the percentages, because you would have to do a weighted calc.&lt;BR /&gt;Just recalculate if needed after reading all.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2006 14:58:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3733290#M101078</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-02-16T14:58:31Z</dc:date>
    </item>
  </channel>
</rss>

