If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > script help please

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-11, 23:50
db2girl db2girl is online now
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,830
script help please

How can I sum up "Total Pages" and "Used Pages" for:

DAT Object Summary
INX Object Summary
LOB Object Summary
LBA Object Summary
XDA Object Summary


in the attached file?


Can I use cut, awk ... to get this info? Please provide some examples.


Thanks
Attached Files
File Type: txt insp.out.txt (96.3 KB, 47 views)
Reply With Quote
  #2 (permalink)  
Old 03-15-11, 03:38
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Code:
awk '/Object Summary: Total/ {tot[$1]+=$6;used[$1]+=$10} 
END {for (n in tot) {printf "%3s %9s %9s\n",n,tot[n],used[n]}}' insp.out.txt

Last edited by pdreyer; 03-15-11 at 04:46.
Reply With Quote
  #3 (permalink)  
Old 03-15-11, 19:43
db2girl db2girl is online now
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,830
Thx a lot!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On