Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > reading out blo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 2090 of 2317
Post > Topic >>

reading out blocks of data, cleaning up data

by dwcasey@[EMAIL PROTECTED] Dec 3, 2007 at 10:21 AM

This is a follow-on post to one I started a couple of weeks ago that
this group gave me such great help.  I am reading in a file, and
pulling out blocks of data between a delimiter ( may not be the right
word ) of SERVER using the following script provided by some folks in
this group.

/SERVER/  { close(f); f = ""; next }
!f && !NF { next }
!f        { split($0, a, ".")
            f = a[2] ".vol" ext
            next }
          { print >f }

This allows me to run awk -v ext=22 -f syscfg6.awk file01 which would
create individual files for each block of data between SERVER
statements from file file01 as ithe nput.

In those blocks between SERVER statements is information about number
and size of disks in a system.  What is a good way to filter out some
of the "extra" content in the files that are created?  For example, I
want to filter out these lines:

 Plex /aggr0/plex0 (online, normal, active)
    RAID group /aggr0/plex0/rg0 (normal)

I'm pulling information from external storage devices and I'm trying
to get to the point where I have "normalized" data.  Then I want to
use that data to sum up the Total number of disks, Total number of
storage ( how many MB's, TB's, etc. ).

So the first script ya'll helped me get a file for each server with
some data.  Now I am trying to clean up data first my removing
unnecessary information like Plex and RAID and still want to try to
keep it all in a single awk program.
 




 4 Posts in Topic:
reading out blocks of data, cleaning up data
dwcasey@[EMAIL PROTECTED]  2007-12-03 10:21:51 
Re: reading out blocks of data, cleaning up data
Ed Morton <mortoneccc@  2007-12-04 08:41:41 
Re: reading out blocks of data, cleaning up data
dwcasey@[EMAIL PROTECTED]  2007-12-04 07:29:42 
Re: reading out blocks of data, cleaning up data
Steffen Schuler <schul  2007-12-05 00:48:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:15:23 CDT 2008.