TStanley has asked for the wisdom of the Perl Monks concerning the following question:
My boss has asked me to put together a script to read the results from a series of top commands from our HP-UX system,
then put the data into a CSV file. The biggest problem that I see, is that the data from each individual top command runs
together, so that there is not a way to actually separate the data into records for easier processing. A small sample
of the data is below:
TStanley
--------
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell
The last six lines of the data (the job information) is data that I do not need. Any suggestions as to how I should proceed with this would be appreciated.System: hpnclass Thu Feb 12 16:31:02 2009 Load averages: 0.51, 0.45, 0.49 541 processes: 483 sleeping, 58 running Cpu states: (avg) LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS 0.51 14.7% 3.0% 18.3% 63.9% 0.0% 0.0% 0.0% 0.0% Memory: 13706264K (11030248K) real, 18023572K (14848696K) virtual, 216 +916K free Page# 1/109 CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU C +OMMAND 1 ? 50 root 152 20 16032K 16032K run 17565:36 24.94 24.89 +vxfsd 2 ? 17979 ora102st 154 24 3989M 3588K sleep 384:22 4.65 4.65 o +ra_s002_pay9 0 ? 2553 ora102st 154 24 3991M 5520K sleep 3308:08 3.47 3.47 o +ra_s000_pay9 3 ? 6585 root 154 24 250M 63652K sleep 10144:59 3.27 3.27 +ucsrvwp 1 ? 17085 ora102st 154 24 3989M 5340K sleep 218:26 2.73 2.72 o +ra_s001_pay9 System: hpnclass Thu Feb 12 16:36:07 2009 Load averages: 0.52, 0.50, 0.50 520 processes: 461 sleeping, 59 running
TStanley
--------
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing a non-formatted record text file
by Fletch (Bishop) on Feb 16, 2009 at 15:44 UTC | |
Re: Parsing a non-formatted record text file
by johngg (Canon) on Feb 16, 2009 at 16:44 UTC | |
by TStanley (Canon) on Feb 16, 2009 at 19:27 UTC | |
Re: Parsing a non-formatted record text file
by Narveson (Chaplain) on Feb 16, 2009 at 16:30 UTC | |
Re: Parsing a non-formatted record text file
by ELISHEVA (Prior) on Feb 16, 2009 at 15:45 UTC | |
Re: Parsing a non-formatted record text file
by kennethk (Abbot) on Feb 16, 2009 at 15:40 UTC | |
Re: Parsing a non-formatted record text file
by TStanley (Canon) on Feb 17, 2009 at 16:29 UTC | |
Re: Parsing a non-formatted record text file
by leocharre (Priest) on Feb 17, 2009 at 15:13 UTC |
Back to
Seekers of Perl Wisdom