To fully illustrate the input, I'll include some Unix `w' (who) output from a Concord agent:

13 1.3.6.1.4.1.546.1.1.5.1.1.1 INTEGER 1
13 1.3.6.1.4.1.546.1.1.5.1.1.2 INTEGER 2
13 1.3.6.1.4.1.546.1.1.5.1.1.3 INTEGER 3
13 1.3.6.1.4.1.546.1.1.5.1.1.4 INTEGER 4
13 1.3.6.1.4.1.546.1.1.5.1.2.1 OctetString user
13 1.3.6.1.4.1.546.1.1.5.1.2.2 OctetString user
13 1.3.6.1.4.1.546.1.1.5.1.2.3 OctetString user
13 1.3.6.1.4.1.546.1.1.5.1.2.4 OctetString user
13 1.3.6.1.4.1.546.1.1.5.1.3.1 OctetString pts/2
13 1.3.6.1.4.1.546.1.1.5.1.3.2 OctetString pts/3
13 1.3.6.1.4.1.546.1.1.5.1.3.3 OctetString pts/4
13 1.3.6.1.4.1.546.1.1.5.1.3.4 OctetString pts/5
13 1.3.6.1.4.1.546.1.1.5.1.4.1 INTEGER 10096
13 1.3.6.1.4.1.546.1.1.5.1.4.2 INTEGER 11928
13 1.3.6.1.4.1.546.1.1.5.1.4.3 INTEGER 4
13 1.3.6.1.4.1.546.1.1.5.1.4.4 INTEGER 21612
13 1.3.6.1.4.1.546.1.1.5.1.5.1 TimeTicks 11d 07:39:59
13 1.3.6.1.4.1.546.1.1.5.1.5.2 TimeTicks 9d 05:47:57
13 1.3.6.1.4.1.546.1.1.5.1.5.3 TimeTicks 14d 03:29:03
13 1.3.6.1.4.1.546.1.1.5.1.5.4 TimeTicks 0d 00:29:52
13 1.3.6.1.4.1.546.1.1.5.1.6.1 OctetString machine.domain.com
13 1.3.6.1.4.1.546.1.1.5.1.6.2 OctetString machine.domain.com
13 1.3.6.1.4.1.546.1.1.5.1.6.3 OctetString machine.domain.com
13 1.3.6.1.4.1.546.1.1.5.1.6.4 OctetString machine.domain.com
12 1.3.6.1.4.1.546.1.1.6.1.0 OctetString 00

I'd like to transform that into lines that mimic traditional w/who output as such

user1 pts/2 10096 11d 07:39:59 machine.domain.com

I'm a bit disheveled as to the most appropriate data structures to use. My only hunch is some iterative way to store the vars into dynamically named subarrays based upon the 1st column's count, then print them w/a ref'd loop or something. Beyond that, I'd like to be able to have any number of columns as input and output them similarly.

In reply to Parsing SNMP output by Anonymous Monk

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.