Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux count number of unique values in column

# Example usage:
awk -F '	' '{print $7}' input_file | sort | uniq -c
# Where: 
# 	- awk returns the 7th tab-delimited column/field of the input_file
# 	- sort sorts the entries so that duplicate entries are adjacent
# 	- uniq -c returns the counts of each type of element

# Note:
#	- add "| cut -c 9-" to remove the counts if you only want the unique values
#		found in the column/field
#	- the entrez-direct tool (conda install entrez-direct) has the command sort-uniq-count
#		and sort-uniq-count-rank that do a better job of formatting the output
Comment

PREVIOUS NEXT
Code Example
Shell :: git store username and password 
Shell :: git delete tag from commit 
Shell :: aircrack-ng rtl8812au 
Shell :: install mocha 
Shell :: bash while true 
Shell :: Update your Dart SDK 
Shell :: how to download youtube playlist ubuntu 
Shell :: check on which domain apache is running 
Shell :: bash script template 
Shell :: exit from sudo su 
Shell :: msiexec wait for completion powershell 
Shell :: ubuntu delete files older than 5 days 
Shell :: ubuntu install geckodriver 
Shell :: bash symlink everything in a directory 
Shell :: how to remove remote ulr 
Shell :: double dollar sign bash 
Shell :: how to check in a library if it is installed in conda 
Shell :: add passphrase to ssh agent 
Shell :: git file line history 
Shell :: display record in postgresql 
Shell :: docker stop and remove specific container 
Shell :: how to check crontab list 
Shell :: bash wait until file exists 
Shell :: install socket.io 
Shell :: install laravel mix 
Shell :: read line by using linnumber shell 
Shell :: github set branch upstream 
Shell :: wait command bash 
Shell :: remove all games ubuntu 
Shell :: How to find sum of elements in array in bash script 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =