Hello!

First thing: your post is unreadable. Try putting <code></code> tags around the route summary text. The other thing: post your solution to this and let us review it. It's not fair if we're doing all the work :)

You can match the desired text in many different ways as long as they're unique for the data lines you want matched. A simple regexp can match these active lines:

while (defined(my $line = <STDIN>)) { if ($line =~ /^inet\((\d+) active/) { print $line; } }

Output:

inet.0: 498154 destinations, 3436699 routes (498150 active, 0 holddown +, 5 hidden) inet.3: 10103 destinations, 10107 routes (10103 active, 0 holddown, 0 +hidden) inet6.0: 25299 destinations, 115803 routes (25299 active, 0 holddown, +0 hidden)

In reply to Re: Capturing route details by arkturuz
in thread Capturing route details by Pavanai

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.