Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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:
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
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.

TStanley
--------
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell

In reply to Parsing a non-formatted record text file by TStanley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found