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
TABS(1) 						    BSD General Commands Manual 						   TABS(1)

NAME
tabs -- set terminal tabs SYNOPSIS
tabs [-n | -a | -a2 | -c | -c2 | -c3 | -f | -p | -s | -u] [+m[n]] [-T type] tabs [-T type] [+[n]] n1[,n2,...] DESCRIPTION
The tabs utility displays a series of characters that clear the hardware terminal tab settings then initialises tab stops at specified posi- tions, and optionally adjusts the margin. In the first synopsis form, the tab stops set depend on the command line options used, and may be one of the predefined formats or at regular intervals. In the second synopsis form, tab stops are set at positions n1, n2, etc. If a position is preceded by a '+', it is relative to the previous position set. No more than 20 positions may be specified. If no tab stops are specified, the ``standard'' UNIX tab width of 8 is used. The options are as follows: -n Set a tab stop every n columns. If n is 0, the tab stops are cleared but no new ones are set. -a Assembler format (columns 1, 10, 16, 36, 72). -a2 Assembler format (columns 1, 10, 16, 40, 72). -c COBOL normal format (columns 1, 8, 12, 16, 20, 55) -c2 COBOL compact format (columns 1, 6, 10, 14, 49) -c3 COBOL compact format (columns 1, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 67). -f FORTRAN format (columns 1, 7, 11, 15, 19, 23). -p PL/1 format (columns 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61). -s SNOBOL format (columns 1, 10, 55). -u Assembler format (columns 1, 12, 20, 44). +m[n], +[n] Set an n character left margin, or 10 if n is omitted. -T type Output escape sequence for the terminal type type. ENVIRONMENT
The LANG, LC_ALL, LC_CTYPE and TERM environment variables affect the execution of tabs as described in environ(7). The -T option overrides the setting of the TERM environment variable. If neither TERM nor the -T option are present, tabs will fail. EXIT STATUS
The tabs utility exits 0 on success, and >0 if an error occurs. SEE ALSO
expand(1), stty(1), tput(1), unexpand(1), termcap(5) STANDARDS
The tabs utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A tabs utility appeared in PWB UNIX. This implementation was introduced in FreeBSD 5.0. BUGS
The current termcap(5) database does not define the 'ML' (set left soft margin) capability for any terminals. BSD
May 20, 2002 BSD
All times are GMT -4. The time now is 08:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy