Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Find unique values but only in column 1 Post 302987598 by RudiC on Tuesday 13th of December 2016 08:30:39 AM
Old 12-13-2016
Or, reading input just once:
Code:
awk -F, '{++C[$1]; T[$1] = $0} END {for (t in T) if (C[t] == 1) print T[t]}'  file
877,RIBDF,E28

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to find only unique values for a given tag across the files

Need to find only unique values for a given tag across the files: For eg: Test1: <Tag1>aaa</Tag1> <Tag2>bbb</Tag2> <Tag3>ccc</Tag3> Test2: <Tag1>aaa</Tag1> <Tag2>ddd</Tag2> <Tag3>eee</Tag3> Test3: <Tag1>aaa</Tag1> <Tag2>ddd</Tag2> <Tag3>eee</Tag3> Test4: (8 Replies)
Discussion started by: sudheshnaiyer
8 Replies

2. Shell Programming and Scripting

Concatenating column values with unique id into single row

Hi, I have a table in Db2 with data say id_1 phase1 id_1 phase2 id_1 phase3 id_2 phase1 id_2 phase2 I need to concatenate the values like id_1 phase1,phase2,phase3 id_2 phase1,phase2 I tried recursive query but in vain as the length of string to be concatenated in quite long. ... (17 Replies)
Discussion started by: jsaravana
17 Replies

3. Shell Programming and Scripting

return a list of unique values of a column from csv format file

Hi all, I have a huge csv file with the following format of data, Num SNPs, 549997 Total SNPs,555352 Num Samples, 157 SNP, SampleID, Allele1, Allele2 A001,AB1,A,A A002,AB1,A,A A003,AB1,A,A ... ... ... I would like to write out a list of unique SNP (column 1). Could you... (3 Replies)
Discussion started by: phoeberunner
3 Replies

4. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

5. Shell Programming and Scripting

Count frequency of unique values in specific column

Hi, I have tab-deliminated data similar to the following: dot is-big 2 dot is-round 3 dot is-gray 4 cat is-big 3 hot in-summer 5 I want to count the frequency of each individual "unique" value in the 1st column. Thus, the desired output would be as follows: dot 3 cat 1 hot 1 is... (5 Replies)
Discussion started by: owwow14
5 Replies

6. Linux

To get all the columns in a CSV file based on unique values of particular column

cat sample.csv ID,Name,no 1,AAA,1 2,BBB,1 3,AAA,1 4,BBB,1 cut -d',' -f2 sample.csv | sort | uniq this gives only the 2nd column values Name AAA BBB How to I get all the columns of CSV along with this? (1 Reply)
Discussion started by: sanvel
1 Replies

7. Shell Programming and Scripting

Extracting unique values of a column from a feed file

Hi Folks, I have the below feed file named abc1.txt in which you can see there is a title and below is the respective values in the rows and it is completely pipe delimited file ,. ... (4 Replies)
Discussion started by: punpun66
4 Replies

8. UNIX for Dummies Questions & Answers

Unique values in a row sum the next column in UNIX

Hi would like to ask you guys any advise regarding my problem I have this kind of data file.txt 111111111,20 111111111,50 222222222,70 333333333,40 444444444,10 444444444,20 I need to get this file1.txt 111111111,70 222222222,70 333333333,40 444444444,30 using this code I can... (6 Replies)
Discussion started by: reks
6 Replies

9. Shell Programming and Scripting

awk to filter out lines containing unique values in a specified column

Hi, I have multiple files that each contain four columns of strings: File1: Code: 123 abc gfh 273 456 ddff jfh 837 789 ghi u4u 395 File2: Code: 123 abc dd fu 456 def 457 nd 891 384 djh 783 I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
Discussion started by: owwow14
3 Replies

10. Shell Programming and Scripting

Count number of unique values in each column of array

What is an efficient way of counting the number of unique values in a 400 column by 1000 row array and outputting the counts per column, assuming the unique values in the array are: A, B, C, D In other words the output should look like: Value COL1 COL2 COL3 A 50 51 52... (16 Replies)
Discussion started by: Geneanalyst
16 Replies
AFSMONITOR(5)							AFS File Reference						     AFSMONITOR(5)

NAME
afsmonitor - Provides instructions for the afsmonitor command DESCRIPTION
The afsmonitor configuration file determines which machines the afsmonitor command probes for File Server or Cache Manager statistics and which statistics it gathers. Use the -config argument to the afsmonitor command to identify the configuration file to use. The instructions that can appear in the configuration file are as follows: cm <host name> Names a client machine for which to display Cache Manager statistics. The order of "cm" lines in the file determines the order in which client machines appear from top to bottom on the "System Overview" and "Cache Managers" output screens. fs <host name> Names a file server machine for which to display File Server statistics. The order of "fs" lines in the file determines the order in which file server machines appear from top to bottom on the "System Overview" and "File Servers" output screens. thresh (fs | cm) <field> <thresh> [<cmd>] [<arg> ...] Assigns the threshold value thresh to the statistic field, for either a File Server statistic ("fs") or a Cache Manager statistic ("cm"). The optional cmd field names a binary or script to execute each time the value of the statistic changes from being below thresh to being at or above thresh. A change between two values that both exceed thresh does not retrigger the binary or script. The optional arg fields are additional values that the afsmonitor program passes as arguments to the cmd command. If any of them include one or more spaces, enclose the entire field in double quotes. The afsmonitor program passes the following parameters to the cmd: <hostname> (fs|cm) <field> <thresh> <actual> [<arg> ...] The parameters "fs", "cm", <field>, <thresh>, and <arg> correspond to the values with the same name on the thresh line. The <hostname> parameter identifies the file server or client machine where the statistic has crossed the threshold, and the <actual> parameter is the actual value of <field> that exceeds the threshold value. Use the "thresh" line to set either a global threshold, which applies to all file server machines listed on "fs" lines or client machines listed on "cm" lines in the configuration file, or a machine-specific threshold, which applies to only one file server or client machine. o To set a global threshold, place the thresh line before any of the "fs" or "cm" lines in the file. o To set a machine-specific threshold, place the thresh line below the corresponding "fs" or "cm" line, and above any other "fs" or "cm" lines. A machine-specific threshold value always overrides the corresponding global threshold, if set. Do not place a "thresh fs" line directly after a "cm" line or a "thresh cm" line directly after a "fs" line. show (fs | cm) field/group/section Specifies which individual statistic, group of statistics, or section of statistics to display on the "File Servers" screen ("fs") or "Cache Managers" screen ("cm") and the order in which to display them. The appendix of afsmonitor statistics in the OpenAFS Administration Guide specifies the group and section to which each statistic belongs. Include as many "show" lines as necessary to customize the screen display as desired, and place them anywhere in the file. The top-to-bottom order of the "show" lines in the configuration file determines the left-to-right order in which the statistics appear on the corresponding screen. If there are no "show" lines in the configuration file, then the screens display all statistics for both Cache Managers and File Servers. Similarly, if there are no "show fs" lines, the "File Servers" screen displays all file server statistics, and if there are no "show cm" lines, the "Cache Managers" screen displays all client statistics. # comments Precedes a line of text that the afsmonitor program ignores because of the initial number ("#") sign, which must appear in the very first column of the line. For a list of the values that can appear in the field/group/section field of a "show" instruction, see the afsmonitor statistics appendix to the OpenAFS Administration Guide. SEE ALSO
afsmonitor(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 AFSMONITOR(5)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy