## Count specific column values

Count specific column values
# 1
01-20-2014
Count specific column values

Hi all:
quick question!

I have the following data that resembles some thing like this:

I want to count (or at least isolate) all of the unique elements in the 2nd column.

I have tried this:
which does not work.
Any help/suggestions on how to solve the problem?
 owwow14 View Public Profile for owwow14 Find all posts by owwow14
# 2
01-20-2014
Try :

You need to sort it before using uniq
following gives you count of occurrence
 Akshay Hegde View Public Profile for Akshay Hegde Find all posts by Akshay Hegde
# 3
01-20-2014
In GNU sort, use -u option:
 Yoda View Public Profile for Yoda Visit Yoda's homepage! Find all posts by Yoda
# 4
01-20-2014
Hello,

Following may also help.

Output will be as follows.

Thanks,
R. Singh
 RavinderSingh13 View Public Profile for RavinderSingh13 Find all posts by RavinderSingh13

## Copy columns from one file into another and get sum of column values and row count

I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv abc.csv- UTF-8,,,,,,,,,,,,,,,,,,,,,,,,, ...

## 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...

## 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...

## Extract values from a specific column to the end

Hello friends, I have a text file with many columns (no. columns vary from row to row) separated by space. I need to collect all the values from 18th column to the end from each line and group them as pairs and then numbering like below.. 1. 18th-col-value 19th-col-value 2. 20th-col-value ...

## Count specific characters at specific column positions

Hi all, I need help. I have an input text file (input.txt) like this: 21 GTGCAACACCGTCTTGAGAGG 50 21 GACCGAGACAGAATGAAAATC 73 21 CGGGTCTGTAGTAGCAAACGC 108 21 CGAAAAATGAACCCCTTTATC 220 21 CGTGATCCTGTTGAAGGGTCG 259 Now I need to count A/T/G/C numbers at each character location in column...

## How to count occurrences in a specific column

Hi, I need help to count the number of occurrences in \$3 of file1.txt. I only know how to count by checking one by one and the code is like this: awk '\$3 ~ /aku hanya poyo/ {++c} END {print c}' FS="\t" file1.txt But this is not wise to do as i have hundreds of different occurrences in that...

## count number of distinct values in each column with awk

Hi ! input: A|B|C|D A|F|C|E A|B|I|C A|T|I|B As the title of the thread says, I would need to get: 1|3|2|4 I tried different variants of this command, but I don't manage to obtain what I need: gawk 'BEGIN{FS=OFS="|"}{for(i=1; i<=NF; i++) a++} END {for (b in a) print b}' input ...

## Count the lines with the same values in a column and write the output to a file

Hey everyone! I have a tab delimited data set which I want to create an output contained the calculation of number of those lines with a certain value in 2nd and 3rd column. my input file is like this: ID1 1 10M AAATTTCCGG ID2 5 4M ACGT ID3 5 8M ACCTTGGA ID4 5 ...

## Word count of values in a column

Hi friends, I have an input file of the following format a b c 1.11112 d e f 4.5767 g h i 19.098 k i l 87.9999 I am looking for an awk one liners that would help me in giving the following output output.txt Range of the column: 1.11112 to 87.9999 Total records between 1 and 10 - 2...

## count number of rows based on other column values

Could anybody help with this? I have input below ..... david,39 david,39 emelie,40 clarissa,22 bob,42 bob,42 tim,32 bob,39 david,38 emelie,47 what i want to do is count how many names there are with different ages, so output would be like this .... david,2 emelie,2 clarissa,1...