[HPADM] Parse file using awk

From: Hazari Shyam (WQQ1SXH) (WQQ1SXH@ups.com)
Date: Tue Sep 16 2003 - 17:16:22 EDT


Admins,
              I got a file in comma separated format and I would like to
parse it. I would like to add the size and no of files column to get a grand
total. As you see some of the contents for size column are in KB,GB and MB.
I would like to convert KB and MB to GB before getting a grand total.

FileSystem Status
Date/time Duration Size No of Files
/u001/app/oracle/oradata/iasdb,File Failure,9/15/03 8:14 PM,00:09:28,516.963
MB,30
/u001/app/oracle/product/ias/9.0.2.0.1/inf,File Failure,9/15/03 8:29
PM,01:09:00,4.105 GB,420
/var,File Failure,9/15/03 9:06 PM,00:24:18,1.084 GB,3988
/usr,File Failure,9/15/03 6:26 PM,00:17:27,30.668 MB,27
/u001/app/oracle/product,File Failure,9/15/03 8:40 PM,00:19:20,766.586 MB,71
/data/UPS/prod_flows,File Failure,9/15/03 7:50 PM,00:28:42,1.737 GB,174
/data/UPS/prod_flows,File Failure,9/15/03 7:50 PM,00:28:42,1.737 GB,174
kyarpp3m.air.ups.com:/u001/app/oracle/product,File Failure,9/15/03 9:37
PM,00:02:57,26.604 MB,11
/D/,File Failure,9/15/03 6:32 PM,00:57:01,3.288 GB,181
/C/,File Failure,9/15/03 6:46 PM,00:00:44,135.000 KB,20
/H/,File Failure,9/15/03 9:00 PM,05:23:36,46.717 GB,296690
/H/,File Failure,9/15/03 9:00 PM,01:19:02,1.757 GB,768
/C/,File Failure,9/15/03 9:09 PM,00:00:36,5.463 MB,52
/W/,File Failure,9/15/03 9:17 PM,00:08:17,7.000 KB,10

I am looking for a simple awk snippet.

Appreciate y'r response

TIA

-Shyam

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:34 EDT