Well, you're in luck. This is the kind of thing that Perl excels at. I don't know what separates the data in the columns, but assuming it's some sort of spacing (or tabs), you could use something like:
# Open the file containing data or abort with error message open(my $fh, "<", "some_file.txt") || die "Can't open file: $!"; # Run through all lines of the file, one by one while(my $line = <$fh>) { # Break up the line on whitespace, assign columns to vars my( $score,$scorePoints, $time,$timePoints, $record,$recordPoints, $size,$sizePoints, $age,$agePoints, $diff,$diffPoints, $size2,$size2Points, $name ) = split(/\s+/,$line,13); # Check to see if name matches if($name =~ /(intrepid|triumph)/) { print "$name\n", "Time: $timePoints, Difficulty: $diffPoints\n\n"; } }
That is, break up the line on spaces, assign each of the columns to variables, then print something if the data matches a test. Since your data is very regular, the code doesn't have to be complicated. You can make some modifications for simplicity:
# Assign only the columns you're interested in my ($timePoints,$diffPoints,$name) = +(split(/\s+/,$line,13))[3,11,1 +4];
Or to eliminate possibly-bogus data:
# Ensure the line consists of 12 integers + something my ( ... ) = ($line =~ /^\s*(?:(\d+)\s*){12}(.*)/);
Or for speed (don't bother splitting lines unless they have intrepid/triumph on them somewhere):
next unless $line =~ /(intrepid|triumph)/; my ( ... ) = ...; print ....;

In reply to Re: Searching for Certain Values by saintly
in thread Searching for Certain Values by Dr.Avocado

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.