Hi, I need help yet again :-). I have a table (ill post a small portion):
21039pa         5005CamdenSouth.3        -          2.4   0.023    50.1    51.9   104.3       -   3.11%  17.43%    2.3%   0.63%   2.53%  30.79%   7.72%       7   0.52%       6   0.94%      16   0.44%      29       0    0.0%       0    0.0%   nj5005CamdenSouth.3(5414)
2178aud         5449Pennington.1         -          8.7   0.392    17.4     8.5    34.5       -   2.84%  17.83%   25.1%   0.15%   2.94%  24.44%  33.24%       3   0.76%      49   4.82%      20   1.03%      72       0    0.0%       0    0.0%   nj5449Pennington.1(12282)
6631pa          5384Chatsworth.1         -         11.0   0.459    12.5    13.2    36.7       -   2.81%  17.67%   30.0%   0.08%   5.28%  26.26%  67.66%       4   1.85%      14   8.81%      38   3.05%      56       3    0.0%       0    0.0%   nj5384Chatsworth.1(5457)
15273pa         0395UpperOxford.3        -          2.3   0.048    10.5    11.6    24.4       -   2.79%   9.60%    9.5%   0.00%   4.00%  15.26%  45.62%       5   1.07%       0   0.00%       8   0.97%      13       0    0.0%       0    0.0%   pa0395UpperOxford.3(12414)
19919pa         0539FisherPark.1         -         22.4   0.110    33.9    27.3    83.6       -   2.42%  16.54%   26.8%   0.14%   1.13%  32.59%  24.54%       3   0.80%      17   2.23%      16   0.70%      36       0    0.0%       0    0.0%   pa0539FisherPark.1(19284)
27850pa         0557Poplar.2             -          0.5   0.170    14.0     6.0    20.5       -   2.34%   6.40%    2.5%   0.00%   1.90%  12.69%  46.68%       1   0.25%       1   1.64%       3   0.29%       5       0    0.0%       0    0.0%   pa0557Poplar.2(14256)
4269aud         0886Longmead.2           -          0.2   0.083     2.8     2.2     5.2       -   2.27%  20.54%    3.6%   0.00%  16.07%   0.00%  10.53%       0   0.00%       0   0.00%       2   1.03%       2       0    0.0%       0    0.0%   pa0886Longmead.2(37040)
15967pa         5458Kenmore.1            -          3.4   0.019    12.7    18.0    34.1       -   2.22%  18.03%   10.0%   0.12%   4.08%  39.05%   3.16%      11   1.10%      18   8.07%      14   0.84%      43       0    0.0%       0    0.0%   md5458Kenmore.1(9399)
1727aud         5029Trenton.2            -          6.5   0.104    63.4    41.2   111.1       -   2.12%  14.48%    5.8%   0.01%   1.52%  38.73%   9.76%      11   0.66%       9   4.09%      39   0.97%      59       0    0.0%       0    0.0%   nj5029Trenton.2(9324)
The thing my boss wants me to do is take the 14th column and compare it to the 11th. And if the 14th is greater than the 11th, print it, if not, dont print it. This is my question, i did, :
foreach $item(@sorted){ @new=split($item); print $new[13]; if($new[13] > $new [10]){ print $item; }
where sorted is the array (each row in the table is one item in the array).
My goal being, taking each line, then splitting it, placing it in a new array, and then comparing and printing.
The problem however, is that when the array is split, i split it at the " " and they have a variable amount of spaces btwn fields to make the columns line up. Any help would be greatly appreciated.
Thanks in advance
Dipul

In reply to Splitting Array with Variable Spaces by ImpalaSS

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.