I leave the file stuff up to you, since that part is easy and you have to code at least some of the project. But here's the regex you need:
use strict;
use warnings;
my %results;
$_ = join '', <DATA>;
($results{'no_of_items'}) = m/Number of Items\s+:\s+(\d+)/;
($results{'size_of_store'}) = m/Size of the Store\s+:\s+(\d+)/;
($results{'aa'}, $results{'ba'}, $results{'ab'}, $results{'bb'}) = m/\
+s+a\s+b\s+<-- classified as\s+(\d+)\s+(\d+)\s+\|\s+\w+ = \d+\s+(\d+)\
+s+(\d+)/;
### Just to display what's in hash, you still need to output it in you
+r format
use Data::Dumper;
print Dumper(\%results);
__DATA__
start of tree
------------------
Da
| something > 1234: 1 (81.06/25.89)
Number of Items : 15
Size of the Store : 30
something else here
=== Summary Matrix ===
a b <-- classified as
11111 222 | a = 0
3333 444 | b = 1
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.