Sponsored Content
Top Forums UNIX for Beginners Questions & Answers List only not unique values of column and count instances of .csv file in UNIX Post 303045022 by SanMota on Wednesday 11th of March 2020 01:22:38 AM
Old 03-11-2020
List only duplicate values of column and count instances of .csv file in UNIX

I need to take any one of the column of a .csv file and count the number of instances of each not unique value in that column. I'd like the output to be value,count sorted by most instances. Thanks for any guidance!

Data example:

Code:
0093320481|4050994|ABC|10-DEC-2001
0093320482|4050994|ADC|10-DEC-2010
9340983269|4819450|SED|06-MAY-1987
9340983269|4819451|MEO|02-FEB-1971


Last edited by vbe; 03-11-2020 at 05:25 AM..
 

9 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

How to count Unique Values from a file.

Hi I have the following info in a file - <Cell id="25D"/> <Cell id="26A"/> <Cell id="26B"/> <Cell id="26C"/> <Cell id="27A"/> <Cell id="27B"/> <Cell id="27C"/> <Cell id="28A"/> I would like to know how would you go about counting all... (4 Replies)
Discussion started by: Prega
4 Replies

3. Shell Programming and Scripting

List unique values and count instances in .csv file

I need to take the second column of a .csv file and count the number of instances of each unique value in that same second column. I'd like the output to be value,count sorted by most instances. Thanks for any guidance! Data example: 317476,317756,0 816063,318861,0 313123,319091,0... (4 Replies)
Discussion started by: batcho
4 Replies

4. Shell Programming and Scripting

Find and count unique date values in a file based on position

Hello, I need some sort of way to extract every date contained in a file, and count how many of those dates there are. Here are the specifics: The date format I'm looking for is mm/dd/yyyy I only need to look after line 45 in the file (that's where the data begins) The columns of... (2 Replies)
Discussion started by: ronan1219
2 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. Shell Programming and Scripting

Count occurrence of column one unique value having unique second column value

Hello Team, I need your help on the following: My input file a.txt is as below: 3330690|373846|108471 3330690|373846|108471 0640829|459725|100001 0640829|459725|100001 3330690|373847|108471 Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies

9. 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
AMC-MAILING(1)						       Auto Multiple Choice						    AMC-MAILING(1)

NAME
AMC-mailing - mail PDF annotated completed answer sheets to students SYNOPSIS
auto-multiple-choice mailing [--xmlargs args.xml] --projet project-dir --students-list students-list.csv [--list-encoding encoding] --email-column col --sender sender-email --subject subject --text email-body [--debug file.log] [transport arguments...] DESCRIPTION
The command AMC-mailing.pl sends by email the PDF annotated completed answer sheets to the students. Email addresses are taken from the students list file. --projet project-dir Gives the project directory. --students-list students-list.csv sets the students list file name. --list-encoding encoding selects an encoding for file students-list.csv (default is utf-8). --email-column col sets the name of the column containing the email addresses of the students in the students list file. --sender sender-email sets the sender email. --subject subject sets the subject of the emails to send. --text email-body sets the body text of the emails to send. --transport transport sets the transport to use. transport may be sendmail or SMTP. --debug file.log gives a file to fill with debugging information. TRANSPORT ARGUMENTS
Depending on the value used for argument transport, the following arguments can be added: Transport sendmail --sendmail-path path sets the path to the sendmail command (defaults to /usr/sbin/sendmail). Transport SMTP --smtp-host host sets the SMTP hostname (defaults to smtp). --smtp-port port sets the port to use (default value is 25). ARGUMENTS IN A XML FILE
To avoid encoding problems, one can place some arguments in a XML file and use the --xmlargs file.xml argument as the first command argument. Here is an exemple of such a file: <?xml version="1.0" encoding="UTF-8"?> <arguments> <arg>--sender</arg><arg>Bienvenue &lt;paamc@passoire.fr&gt;</arg> <arg>--text</arg><arg>Voila votre copie corrigee</arg> <arg>--subject</arg><arg>QCM</arg> </arguments> AUTHORS
Alexis Bienvenue <paamc@passoire.fr> Main author Jean Berard Translation from French Georges Khaznadar Translation from French COPYRIGHT
Copyright (C) 2008-2012 Alexis Bienvenue This document can be used according to the terms of the GNU General Public License, version 2 or later. Auto Multiple Choice 1.1.1 06/19/2012 AMC-MAILING(1)
All times are GMT -4. The time now is 07:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy