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.


|