- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script needed
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 02:36 AM
тАО10-08-2008 02:36 AM
Below pasted is the report generated via MWA export. Now What I need is a script which will grep only the columns in Hour basis ,lets say 00.00 , 01.00 , 02.00
Replies will be highly appreciated with points.
"MWA Export 10/08/08 10:19 AM Logfile: /var/opt/perf/datafiles/ SCOPE/UX C.03.71.00 batebsd1"
" "|" "|" "|" Peak "|"Memory"|" "|
" Date "|"Time "|"CPU % "|"Disk %"|" % "|"Swap %"|
"09/08/08"|"00:00"| 28.57|100.00| 79.62| 44.00|
"09/08/08"|"00:05"| 39.39| 91.85| 79.85| 44.00|
"09/08/08"|"00:10"| 11.48|100.00| 79.87| 44.00|
"09/08/08"|"00:15"| 7.71|100.00| 80.36| 45.00|
"09/08/08"|"00:20"| 8.25|100.00| 80.35| 45.00|
"09/08/08"|"00:25"| 8.44|100.00| 81.76| 46.00|
"09/08/08"|"00:30"| 7.64|100.00| 80.91| 45.00|
"09/08/08"|"00:35"| 8.43|100.00| 81.34| 45.00|
"09/08/08"|"00:40"| 11.69|100.00| 81.37| 45.00|
"09/08/08"|"00:45"| 18.02| 87.10| 81.33| 45.00|
"09/08/08"|"00:50"| 28.56| 69.90| 82.37| 46.00|
"09/08/08"|"00:55"| 19.33| 71.11| 81.35| 45.00|
"09/08/08"|"01:00"| 19.16| 65.81| 81.31| 45.00|
"09/08/08"|"01:05"| 17.46| 66.03| 81.31| 45.00|
"09/08/08"|"01:10"| 16.99| 68.01| 81.31| 45.00|
"09/08/08"|"01:15"| 16.92| 69.28| 81.31| 45.00|
"09/08/08"|"01:20"| 17.41| 70.75| 81.31| 45.00|
"09/08/08"|"01:25"| 16.43| 74.13| 81.31| 45.00|
"09/08/08"|"01:30"| 12.91| 80.88| 78.78| 44.00|
"09/08/08"|"01:35"| 6.68| 78.69| 78.66| 44.00|
"09/08/08"|"01:40"| 6.84| 67.62| 78.66| 44.00|
"09/08/08"|"01:45"| 6.61| 31.24| 74.96| 42.00|
"09/08/08"|"01:50"| 0.83| 1.10| 74.96| 42.00|
"09/08/08"|"01:55"| 0.87| 0.71| 74.96| 42.00|
"09/08/08"|"02:00"| 0.86| 0.87| 74.96| 42.00|
Rgds
Vinayan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 02:47 AM
тАО10-08-2008 02:47 AM
Re: Script needed
grep ":00" filename
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 03:16 AM
тАО10-08-2008 03:16 AM
Re: Script needed
Inperfect because you wrote 00.00 as hour and probably meant 00:00, and in " grep only the columns in Hour " the 'grep' is not an English verb best I know, but you possibly meant 'extract using the tool grep' there by severely limiting the range of possile solution. And the columns in Hour is really column #2, but you probably meant the worst with a whole hour in column #2.
awk '/:00/ || NR < 4' your-file
grins,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 03:18 AM
тАО10-08-2008 03:18 AM
Re: Script needed
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 03:47 AM
тАО10-08-2008 03:47 AM
Re: Script needed
grep "[0-9][0-9]:00" filename
This should get the records for
00:00
01:00
02:00
down to
23:00
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 03:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 03:52 AM
тАО10-08-2008 03:52 AM
Re: Script needed
Here's an expanded line to make it Excel CSV compatible:
grep "[0-9][0-9]:00" test.txt | awk -F\| '{print $1","$2","$3","$4","$5","$6}' > somefile.csv
Output looks like:
"09/08/08","00:00", 28.57,100.00, 79.62, 44.00
"09/08/08","01:00", 19.16, 65.81, 81.31, 45.00
"09/08/08","02:00", 0.86, 0.87, 74.96, 42.00
If you want to get rid of the double quotes too (really slow day)
grep "[0-9][0-9]:00" test.txt | awk -F\| '{print $1","$2","$3","$4","$5","$6}' | sed -e 's/"//g' >> somefilename.csv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 03:54 AM
тАО10-08-2008 03:54 AM
Re: Script needed
But you'll have to dig through any manuals you can find to discover the command. Been a few years since I did that.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2008 04:14 AM
тАО10-08-2008 04:14 AM