<?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 optimization required for this perl script(taking long time to execute) for huge data file. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601232#M823980</link>
    <description>open INP, "&amp;lt; testupc.txt " or die "testcpnnew.txt: $!";&lt;BR /&gt;while ($x=&lt;INP&gt;) {&lt;BR /&gt;chomp($x);&lt;BR /&gt;@y=split(/\|/,$x);&lt;BR /&gt;$value=@y[12];&lt;BR /&gt;$x=@y[5];&lt;BR /&gt;$y=@y[11];&lt;BR /&gt;$z=@y[10];&lt;BR /&gt;if ($value !=0)&lt;BR /&gt;{&lt;BR /&gt;@A=(@A,$x*$value*100);&lt;BR /&gt;}&lt;BR /&gt;if ($value==0)&lt;BR /&gt;{&lt;BR /&gt;@A=(@A,$y*$z*100);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;close INP;&lt;BR /&gt;$i=0;&lt;BR /&gt;while ($i &amp;lt;@A)&lt;BR /&gt;{&lt;BR /&gt;print $A[$i], "\n";&lt;BR /&gt;$i++;&lt;BR /&gt;if ($A[$i]&amp;lt; 0){$a++}&lt;BR /&gt;if (($A[$i] &amp;gt;=0)&amp;amp;&amp;amp; ($A[$i] &amp;lt;10)) {$b++}&lt;BR /&gt;elsif (($A[$i] &amp;gt;=10)&amp;amp;&amp;amp;($A[$i] &amp;lt; 20)) {$c++}&lt;BR /&gt;elsif (($A[$i]&amp;gt;= 20)&amp;amp;&amp;amp;($A[$i]&amp;lt; 30)) {$d++}&lt;BR /&gt;elsif (($A[$i] &amp;gt;= 30)&amp;amp;&amp;amp;($A[$i]&amp;lt; 40)) {$e++}&lt;BR /&gt;elsif (($A[$i]&amp;gt;= 40)&amp;amp;&amp;amp;($A[$i]&amp;lt; 50)) {$f++}&lt;BR /&gt;elsif ($A[$i]&amp;gt;= 50) {$g++}&lt;BR /&gt;}&lt;BR /&gt;printf("Transaction amount frequency  Less Than 0 = %d\n",$a);&lt;BR /&gt;printf("Transaction amount frequency between  [0-9] = %d\n",$b);&lt;BR /&gt;printf("Transaction amount frequency between  [10-19] = %d\n",$c);&lt;BR /&gt;printf("Transaction amount frequency between [20-29] = %d\n",$d);&lt;BR /&gt;printf("Transaction amount frequency between  [30-39] = %d\n",$e);&lt;BR /&gt;printf("Transaction amount frequency between [40-49] = %d\n",$f);&lt;BR /&gt;printf("Transaction amount frequency between 50 and above = %d\n",$g);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/INP&gt;</description>
    <pubDate>Thu, 11 Aug 2005 01:25:56 GMT</pubDate>
    <dc:creator>kiran1977</dc:creator>
    <dc:date>2005-08-11T01:25:56Z</dc:date>
    <item>
      <title>optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601232#M823980</link>
      <description>open INP, "&amp;lt; testupc.txt " or die "testcpnnew.txt: $!";&lt;BR /&gt;while ($x=&lt;INP&gt;) {&lt;BR /&gt;chomp($x);&lt;BR /&gt;@y=split(/\|/,$x);&lt;BR /&gt;$value=@y[12];&lt;BR /&gt;$x=@y[5];&lt;BR /&gt;$y=@y[11];&lt;BR /&gt;$z=@y[10];&lt;BR /&gt;if ($value !=0)&lt;BR /&gt;{&lt;BR /&gt;@A=(@A,$x*$value*100);&lt;BR /&gt;}&lt;BR /&gt;if ($value==0)&lt;BR /&gt;{&lt;BR /&gt;@A=(@A,$y*$z*100);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;close INP;&lt;BR /&gt;$i=0;&lt;BR /&gt;while ($i &amp;lt;@A)&lt;BR /&gt;{&lt;BR /&gt;print $A[$i], "\n";&lt;BR /&gt;$i++;&lt;BR /&gt;if ($A[$i]&amp;lt; 0){$a++}&lt;BR /&gt;if (($A[$i] &amp;gt;=0)&amp;amp;&amp;amp; ($A[$i] &amp;lt;10)) {$b++}&lt;BR /&gt;elsif (($A[$i] &amp;gt;=10)&amp;amp;&amp;amp;($A[$i] &amp;lt; 20)) {$c++}&lt;BR /&gt;elsif (($A[$i]&amp;gt;= 20)&amp;amp;&amp;amp;($A[$i]&amp;lt; 30)) {$d++}&lt;BR /&gt;elsif (($A[$i] &amp;gt;= 30)&amp;amp;&amp;amp;($A[$i]&amp;lt; 40)) {$e++}&lt;BR /&gt;elsif (($A[$i]&amp;gt;= 40)&amp;amp;&amp;amp;($A[$i]&amp;lt; 50)) {$f++}&lt;BR /&gt;elsif ($A[$i]&amp;gt;= 50) {$g++}&lt;BR /&gt;}&lt;BR /&gt;printf("Transaction amount frequency  Less Than 0 = %d\n",$a);&lt;BR /&gt;printf("Transaction amount frequency between  [0-9] = %d\n",$b);&lt;BR /&gt;printf("Transaction amount frequency between  [10-19] = %d\n",$c);&lt;BR /&gt;printf("Transaction amount frequency between [20-29] = %d\n",$d);&lt;BR /&gt;printf("Transaction amount frequency between  [30-39] = %d\n",$e);&lt;BR /&gt;printf("Transaction amount frequency between [40-49] = %d\n",$f);&lt;BR /&gt;printf("Transaction amount frequency between 50 and above = %d\n",$g);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/INP&gt;</description>
      <pubDate>Thu, 11 Aug 2005 01:25:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601232#M823980</guid>
      <dc:creator>kiran1977</dc:creator>
      <dc:date>2005-08-11T01:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601233#M823981</link>
      <description>Can you post testupc.txt contents with sample lines?&lt;BR /&gt;&lt;BR /&gt;I am suggesting few ways as,&lt;BR /&gt;&lt;BR /&gt; a) Don't use elif. Use if directly to that.&lt;BR /&gt; b) $value=@y[12];&lt;BR /&gt;$x=@y[5];&lt;BR /&gt;$y=@y[11];&lt;BR /&gt;$z=@y[10];&lt;BR /&gt;&lt;BR /&gt; instead use,&lt;BR /&gt;&lt;BR /&gt;  ($value,$x,$y,$z)=@y[12,5,11,10];&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 11 Aug 2005 02:51:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601233#M823981</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-11T02:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601234#M823982</link>
      <description>Replace:&lt;BR /&gt;&amp;gt; if ($value !=0)&lt;BR /&gt;&amp;gt; {&lt;BR /&gt;&amp;gt; @A=(@A,$x*$value*100);&lt;BR /&gt;&amp;gt; }&lt;BR /&gt;&amp;gt; if ($value==0)&lt;BR /&gt;&amp;gt; {&lt;BR /&gt;&amp;gt; @A=(@A,$y*$z*100);&lt;BR /&gt;&amp;gt; }&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;push @A, (($value==0)?$y*$z*100:$x*$value*100);&lt;BR /&gt;&lt;BR /&gt;also &lt;BR /&gt;use &lt;BR /&gt;&lt;BR /&gt;@y=split(/\|/,$x,13);     # don't split it into more than 13 parts, if you're only interested up to the 12th element&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Again some details about the file would be useful</description>
      <pubDate>Thu, 11 Aug 2005 02:52:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601234#M823982</guid>
      <dc:creator>Derek Whigham_1</dc:creator>
      <dc:date>2005-08-11T02:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601235#M823983</link>
      <description>Try with this script.&lt;BR /&gt;&lt;BR /&gt;==============&lt;BR /&gt;# &lt;BR /&gt;open INP, "testupc.txt " or die "testcpnnew.txt: $!";&lt;BR /&gt;while (chomp(&lt;INP&gt;)) {&lt;BR /&gt;&lt;BR /&gt;($x,$z,$y,$value)=(split (/\|/))[5,10,11,12];&lt;BR /&gt;push @A, (($value==0)?$y*$z*100:$x*$value*100);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;close INP;&lt;BR /&gt;my $i=0;&lt;BR /&gt;while ($i &amp;lt; @A)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;$var=$A[$i];&lt;BR /&gt;&lt;BR /&gt;if ($var&amp;lt; 0){$a++}&lt;BR /&gt;if (($var &amp;gt;=0)&amp;amp;&amp;amp; ($var &amp;lt;10)) {$b++}&lt;BR /&gt;if (($var &amp;gt;=10)&amp;amp;&amp;amp;($var &amp;lt; 20)) {$c++}&lt;BR /&gt;if (($var&amp;gt;= 20)&amp;amp;&amp;amp;($var&amp;lt; 30)) {$d++}&lt;BR /&gt;if (($var &amp;gt;= 30)&amp;amp;&amp;amp;($var&amp;lt; 40)) {$e++}&lt;BR /&gt;if (($var&amp;gt;= 40)&amp;amp;&amp;amp;($var&amp;lt; 50)) {$f++}&lt;BR /&gt;if ($var&amp;gt;= 50) {$g++}&lt;BR /&gt;&lt;BR /&gt;print $A[$i++], "\n";&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;printf("Transaction amount frequency Less Than 0 = %d\n",$a);&lt;BR /&gt;printf("Transaction amount frequency between [0-9] = %d\n",$b);&lt;BR /&gt;printf("Transaction amount frequency between [10-19] = %d\n",$c);&lt;BR /&gt;printf("Transaction amount frequency between [20-29] = %d\n",$d);&lt;BR /&gt;printf("Transaction amount frequency between [30-39] = %d\n",$e);&lt;BR /&gt;printf("Transaction amount frequency between [40-49] = %d\n",$f);&lt;BR /&gt;printf("Transaction amount frequency between 50 and above = %d\n",$g);&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;PS: Post your input and required output to give suitable script more.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/INP&gt;</description>
      <pubDate>Thu, 11 Aug 2005 03:26:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601235#M823983</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-11T03:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601236#M823984</link>
      <description>this code works fine but, for HUGE DATA am getting out of memory. please check this code to work for huge data. for smaller data it is working fine. i have used Data size 1439261668)then am geetu=ing oyt of memory. please le me know this issue ASAP. &lt;BR /&gt;Great Thanks in Advance,&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Aug 2005 00:55:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601236#M823984</guid>
      <dc:creator>kiran1977</dc:creator>
      <dc:date>2005-08-17T00:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601237#M823985</link>
      <description>You don't need to read the entire file into @A. I haven't tested it, but here is another version that processes the file as it reads it.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;Rod Hills&lt;BR /&gt; &lt;BR /&gt;open INP, "testupc.txt " or die "testcpnnew.txt: $!";&lt;BR /&gt;while (chomp(&lt;INP&gt;)) {&lt;BR /&gt;($x,$z,$y,$value)=(split (/\|/))[5,10,11,12];&lt;BR /&gt;$var=($value==0)?$y*$z*100:$x*$value*100);&lt;BR /&gt;print $var,"\n";&lt;BR /&gt;if ($var &amp;lt; 0) { $cnt[0]++; }&lt;BR /&gt; else {&lt;BR /&gt;  $inx=($var&amp;gt;=0)+($var&amp;gt;=10)+($var&amp;gt;=20)+($var&amp;gt;=30)+($var&amp;gt;=40)+($var&amp;gt;=50);&lt;BR /&gt;  $cnt[$inx]++;&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;close INP;&lt;BR /&gt;for $rng (0..6) {&lt;BR /&gt; if ($rng &amp;lt; 0) { $msg="Less Than 0";}&lt;BR /&gt; elsif ($rng == 6) { $msg="between 50 and above"; }&lt;BR /&gt; else { $msg=sprintf("between [%2.2d-%2.2d]",10*$rng-10,10*$rng-1); }&lt;BR /&gt; printf("Transaction amount frequency %20s = %d\n",$cnt[$i]);&lt;BR /&gt;}&lt;/INP&gt;</description>
      <pubDate>Wed, 17 Aug 2005 10:00:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601237#M823985</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-08-17T10:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: optimization required for this perl script(taking long time to execute) for huge data file.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601238#M823986</link>
      <description>Correction to one line&lt;BR /&gt;if ($rng &amp;lt; 0) { $msg="Less Than 0";}&lt;BR /&gt; &lt;BR /&gt;should be&lt;BR /&gt;if ($rng == 0) { $msg="Less Than 0";}&lt;BR /&gt;&lt;BR /&gt;Rod Hills&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Aug 2005 10:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/optimization-required-for-this-perl-script-taking-long-time-to/m-p/3601238#M823986</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-08-17T10:05:23Z</dc:date>
    </item>
  </channel>
</rss>

