Sponsored Content
Top Forums Shell Programming and Scripting Getting max value of specific fields with awk Post 302992228 by sayami00 on Thursday 23rd of February 2017 05:43:05 AM
Old 02-23-2017
Dear RudiC and Raj ,

Thanks a lot . Both code are working for me .
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

2. UNIX for Dummies Questions & Answers

Updating specific fields with awk using conditions

Can someone help me again, I think with awk? I have a file with 4 columns (pipe-delimited): I just want to convert the last field so that e1 is now 'message 1', e2 is 'message 2', e0 is 'message 3', etc. I don't want to change any other columns because the e0-e10 code may appear as part of a... (4 Replies)
Discussion started by: giannicello
4 Replies

3. Shell Programming and Scripting

awk summing specific lines and fields

Hi I would like to know if it is possible to sum some specific fields. I have this x;x;x;x;x;x;x;x;467,390,611 Bytes;0.435291 GB;0.062247 GB;0.373045 GB;11,225;157 a;a;a;a;a;a;a;a;13,805,156,846 Bytes;12.857054 GB;1.838559 GB;11.018495 GB;151,063;18,933 b;b;b;b;b;b;b;b;232,797,478,723... (5 Replies)
Discussion started by: nakaedu
5 Replies

4. UNIX for Dummies Questions & Answers

Read the file and generate specific fields by awk

Hi I need to generate these output file from the below input file. Output : customer_id as customer, zip as zip_cd, catg_cd as catg, Input: out.customer::in.customer_id; out.zip_cd::in.zip; out.catg::in.catg_cd; Could you please help me on this. Please use code tags next... (1 Reply)
Discussion started by: Murugesh
1 Replies

5. Shell Programming and Scripting

awk partial string match and add specific fields

Trying to combine strings that are a partial match to another in $1 (usually below it). If a match is found than the $2 value is added to the $2 value of the match and the $3 value is added to the $3 value of the match. I am not sure how to do this and need some expert help. Thank you :). file ... (2 Replies)
Discussion started by: cmccabe
2 Replies

6. Shell Programming and Scripting

awk to output match and mismatch with count using specific fields

In the below awk I am trying output to one file those lines that match between $2,$3,$4 of file1 and file2 with the count in (). I am also trying to output those lines that are missing between $2,$3,$4 of file1 and file2 with the count of in () each. Both input files are tab-delimited, but the... (7 Replies)
Discussion started by: cmccabe
7 Replies

7. Shell Programming and Scripting

awk to combine all matching fields in input but only print line with largest value in specific field

In the below I am trying to use awk to match all the $13 values in input, which is tab-delimited, that are in $1 of gene which is just a single column of text. However only the line with the greatest $9 value in input needs to be printed. So in the example below all the MECP2 and LTBP1... (0 Replies)
Discussion started by: cmccabe
0 Replies

8. UNIX for Beginners Questions & Answers

Grep or awk a unique and specific word across many fields

Hi there, I have data with similar structure as this: CHR START-SNP END-SNP REF ALT PATIENT1 PATIENT2 PATIENT3 PATIENT4 chr1 69511 69511 A G homo hetero homo hetero chr2 69513 69513 T C . hetero homo hetero chr3 69814 69814 G C . . homo homo chr4 69815 69815 C A hetero . . hetero is... (10 Replies)
Discussion started by: daashti
10 Replies

9. UNIX for Beginners Questions & Answers

How do you preserve the max length of a line after replacing a specific value?

I'm new with scripting and I can't seem to figure out what I should do to get the output that I want. My file content would be below. ID2|ID3 |ID4|ID5 | I'm trying to replace the field of ID3 which has a fixed length of 10 characters, for each entry I have placed on a .txt file... (5 Replies)
Discussion started by: asdfghjkl
5 Replies
SIZE(1) 						    BSD General Commands Manual 						   SIZE(1)

NAME
size -- display section sizes and total size of ELF objects SYNOPSIS
size [--format=format] [--help] [--radix=radix] [--totals] [--version] [-ABVdhotx] [file ...] DESCRIPTION
The size utility lists the sizes of ELF sections, and optionally the total size, for each input file specified on the command line. The size utility can operate on ELF objects, on ar(1) archives containing ELF objects, and on core dumps. If no file name is specified on the com- mand-line, a.out is assumed. The size utility recognized the following options: --format=format Display output using the format specified by argument format. Supported values for this argument are: 'berkeley' and 'sysv'. The default output format is 'berkeley'. See Display Formats below for more information. --help Display a help message and exit. --radix=radix Display numeric values using the radix specified by argument radix. Supported values for radix are 8, 10 and 16. The default radix is 10. --totals Shows cumulative totals of section sizes from all objects. This option is ignored for System V style output. --version Display a version identifier and exit. -A Equivalent to specifying option --format=sysv. -B Equivalent to specifying option --format=berkeley. -V Equivalent to specifying option --version. -d Equivalent to specifying option --radix=10. -h Equivalent to specifying option --help. -o Equivalent to specifying option --radix=8. -t Equivalent to specifying option --totals. -x Equivalent to specifying option --radix=16. DISPLAY FORMATS
Berkeley Style Output If 'berkeley' style output is in effect, an initial header line naming fields will be output, followed by one line of output for each ELF object specified on the command line or found in an archive. Each line will contain the following whitespace separated fields in order: 1. The size of the text segment in the object. 2. The size of the data segment in the object. 3. The size of the 'bss' segment in the object. 4. The total size of the object in either decimal or octal. Decimal output is used if the specified output radix for numeric values is 10 or 16. Octal output is used if the radix being used for numeric values is 8. 5. The total size of the object in hexadecimal. 6. The file name of the object. If option --totals was specified, an additional line in the same format as above will be output at the end containing the sum of the respec- tive fields. The file name field for the line will contain the string '(TOTALS)'. System V Style Output If System V style output is selected, size will output the following information for each object: 1. The name of the object followed by a colon. 2. A header line containing the names of fields of subsequent lines. 3. One line per section present in the object. Each line has three fields: 1. The name of the section. 2. Its size, in the selected radix for numeric values. 3. The address associated with the section, in the selected numeric radix. 4. A line whose section name field contains the string 'Total' and whose size field contains the sum of all reported section sizes. EXIT STATUS
The size utility exits 0 on success, and >0 if an error occurs. EXAMPLES
To display the section sizes for /bin/ls use: $ size /bin/ls text data bss dec hex filename 20975 540 392 21907 5593 /bin/ls To display sizes and total for /bin/ls and /bin/dd in hexadecimal, use: $ size -tx /bin/ls /bin/dd text data bss dec hex filename 0x51ef 0x21c 0x188 21907 5593 /bin/ls 0x3df5 0x170 0x200 16741 4165 /bin/dd 0x8fe4 0x38c 0x388 38648 96f8 (TOTALS) To display section sizes for /bin/ls in System V format use: $ size -A /bin/ls /bin/ls : section size addr .interp 21 4194704 .note.ABI-tag 24 4194728 .hash 624 4194752 .dynsym 2088 4195376 .dynstr 810 4197464 .rela.dyn 120 4198280 .rela.plt 1656 4198400 .init 19 4200056 .plt 1120 4200076 .text 15224 4201200 .fini 14 4216424 .rodata 1472 4216448 .data 80 5267456 .eh_frame 1624 5267536 .dynamic 384 5269160 .ctors 16 5269544 .dtors 16 5269560 .jcr 8 5269576 .got 576 5269584 .bss 528 5270176 .comment 686 0 Total 27110 SEE ALSO
ar(1), nm(1), objdump(1), readelf(1), strings(1), elf(3), gelf(3) AT&T Unix Systems Labs, System V Application Binary Interface, http://www.sco.com/developers/gabi/. HISTORY
The size utility first appeared in Version 6 AT&T UNIX. AUTHORS
The size utility was re-written by S. Sam Arun Raj <samarunraj@gmail.com> This manual page was written by S. Sam Arun Raj <samarunraj@gmail.com> BSD
August 25, 2011 BSD
All times are GMT -4. The time now is 04:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy