Sponsored Content
Top Forums Shell Programming and Scripting Need to pick max values of the columns Post 302907434 by reddyr on Friday 27th of June 2014 08:42:21 PM
Old 06-27-2014
Need to pick max values of the columns

Hi,

I have sar disk reports like below sample:

Code:
01:01:00    hdisk24      0      0.0        0        0      0.0      0.0
            hdisk15      0      0.0        0        3      0.0      5.5
            hdisk20      0      0.0        2        1      0.0      1.9
            hdisk19      1      0.0        2        1      0.0      4.5
            hdisk18      0      0.0        0        0      0.0      0.0
            hdisk16      0      0.0        0        0      0.0      0.0
            hdisk22      0      0.0        0        0      0.0      0.0
            hdisk14      0      0.0        1        5      0.1      1.0
            hdisk21      1      0.0        2        1      0.0      3.8
            hdisk17      0      0.0        0        0      0.0      0.5
            hdisk23      0      0.0        0        0      0.0      0.0
             hdisk2      0      0.0        0        0      0.0      0.0
             hdisk0      0      0.0        0        0      0.0      1.8


01:06:00    hdisk24      0      0.0        0       24      0.0      7.3
            hdisk15      0      0.0        1       95      0.1      4.2
            hdisk20      0      0.0        2        1      0.0      2.3
            hdisk19      0      0.0        2        1      0.0      2.2
            hdisk18      0      0.0        0        0      0.0      0.0
            hdisk16      0      0.0        0        0      0.0      0.0
            hdisk22      0      0.0        0        0      0.0      0.0
            hdisk14      0      0.0        1        9      0.9      2.0
            hdisk21      0      0.0        2        1      0.0      2.8
            hdisk17      0      0.0        0        0      0.0      1.1
            hdisk23      0      0.0        0       22      0.0      9.1
             hdisk2      0      0.0        0        0      0.0      0.0
             hdisk0      0      0.0        0        0      0.0      2.2


01:11:00    hdisk24      0      0.0        0        0      0.0      0.0
            hdisk15      0      0.0        0        6      0.0      2.5
            hdisk20      0      0.0        2        1      0.0      1.4
            hdisk19      0      0.0        2        1      0.0      1.5
            hdisk18      0      0.0        0        0      0.0      0.0
            hdisk16      0      0.0        0        0      0.0      0.0
            hdisk22      0      0.0        0        0      0.0      0.0
            hdisk14      0      0.0        1       10      0.3      1.6
            hdisk21      0      0.0        2        1      0.0      2.2
            hdisk17      0      0.0        0        0      0.0      0.7
            hdisk23      0      0.0        0        0      0.0      0.0
             hdisk2      0      0.0        0        0      0.0      0.0
             hdisk0      0      0.0        0        0      0.0      1.6

I need to pick the max values of each column and discard the hard drive (column 2) so that output would be like:
Code:
01:01:00    1      0.0        2        5      0.1      5.5
01:06:00    0      0.0        2       95      0.9      9.1	
01:11:00    0      0.0        2       10      0.3      2.5

Pls advise, thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

max values amd min values

Hello every one, I have following data ***CAMPAIGN 1998 CONTRIBUTIONS*** --------------------------------------------------------------------------- NAME PHONE Jan | Feb | Mar | Total Donated ... (12 Replies)
Discussion started by: devmiral
12 Replies

2. Shell Programming and Scripting

Local max values of a file

I have a data file of two columns (corresponding to the x and y axes of a graph) separated by a comma. I want to find the local maximum values and print them to a file. It has been a while since I've done any scripting and I've forgotten everything. I have a few basic questions. 1.) How do... (1 Reply)
Discussion started by: jemm
1 Replies

3. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

4. Shell Programming and Scripting

pick columns

I want to be able pick columns from 2 files with similar reference data: File 1 Last NameFirst NameSalaryCityDunnJohn $42,000.00 ChicagoGrantSuzy $95,000.00 GaryLoweMike $80,000.00 MilwaukeeGrantMike $59,000.00 JolietLoweKaren $48,000.00 South BendFile 2 TitleFirst NameLast... (2 Replies)
Discussion started by: sigh2010
2 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Print a line using a max and a min values of different columns

Hi guys, I already search on the forum but i can't solve this on my own. I have a lot of files like this: And i need to print the line with the maximum value in last column but if the value is the same (2 in this exemple for the 3 last lines) i need get the line with the minimum value in... (4 Replies)
Discussion started by: MetaBolic0
4 Replies

6. UNIX for Dummies Questions & Answers

Pick out columns according to list of column names

Hi Everyone: I'm new to linux and I was wondering what the best way to approach the following problem was. I have 2 files: File A: ID123 ID234 ID456 File B: ID123 ID234 ID345 ID456 A B C D E F G H I J K L Based on the list of IDs in File A, I want to output only the... (3 Replies)
Discussion started by: chongm88
3 Replies

7. Shell Programming and Scripting

How to get min and max values using awk?

Hi, I need your kind help to get min and max values from file based on value in $5 . File1 SP12.3 stc 2240806 2240808 + ID1_N003 ID2_N003T0 SP12.3 sto 2241682 2241684 + ID1_N003 ID2_N003T0 SP12.3 XE 2239943 2240011 + ID1_N003 ID2_N003T0 SP12.3 XE 2240077 2241254 + ID1_N003 ... (12 Replies)
Discussion started by: redse171
12 Replies

8. Shell Programming and Scripting

Add sum of columns and max as new row

Hi, I am a new bie i need some help with respect to shell onliner; I have data in following format Name FromDate UntilDate Active Changed Touched Test 28-03-2013 28-03-2013 1 0.6667 100 Test2 28-03-2013 03-04-2013 ... (1 Reply)
Discussion started by: gangaraju6
1 Replies

9. Shell Programming and Scripting

Regex in Shell Scripting to pick values

Hi After lot of trial and error I am really bowled out with the requirement in hand and honestly you are my last hope Here is what I want to achieve Values *IF *VALUE MS_SQL_Statistics_Summary.Client_Count_Percent_Used *GT 70.00 *AND *VALUE... (20 Replies)
Discussion started by: radioactive9
20 Replies

10. Programming

DB2 Query to pick hierarchy values

Dear Team I am using DB2 v9 . I have a condition to check roles based on hierarchies like below example. 1.Ramesh has Roles as "Manager" and "Interviewer" 2.KITS has Roles as "Interviewer" 3.ANAND has Roles as "Manager" and "Interviewer" select * FROM TESTING NAME ... (6 Replies)
Discussion started by: Perlbaby
6 Replies
Locale::Codes::LangExt(3)				User Contributed Perl Documentation				 Locale::Codes::LangExt(3)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-02-27 Locale::Codes::LangExt(3)
All times are GMT -4. The time now is 10:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy