in reply to Proper way to work with columns

Hello nikita.af,

Have you looked at the module Test::Parser::Iostat? I haven’t tried it (I’m not on Unix), but it might be just what you’re looking for.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Proper way to work with columns
by huck (Prior) on Dec 27, 2016 at 07:15 UTC

    https://metacpan.org/source/MARKWKM/Test-Parser-1.9/lib/Test/Parser/Iostat.pm

    I thought it might be at least a model to steal code from, but it seems Test::Parser::Iostat uses a fixed set of columns

    push @{$self->{data}}, {device => $i[0], rrqm => $i[1], wrqm => $i[2 +], r => $i[3], w => $i[4], rmb => $i[5], wmb => $i[6], avgrq +=> $i[7], avgqu => $i[8], await => $i[9], svctm => $i[10], util => $ +i[11], elapsed_time => $self->{elapsed_time}};
    and he suggest he has seen the cols change on different releases.

Re^2: Proper way to work with columns
by nikita.af (Acolyte) on Dec 27, 2016 at 05:54 UTC

    Hello Athanasius, I want to avoid using CPAN modules as I don't have a root privileges to install modules. If it possible to parse the output by "native" perl code I prefer this way.

      Hello Athanasius, I want to avoid using CPAN modules as I don't have a root privileges to install modules. If it possible to parse the output by "native" perl code I prefer this way.

      Hi,

      Root privileges are not required to install module see Yes, even you can use CPAN

        Yes, I know, but it's not my case due to some specific system design on our servers.