Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash calculate the mean of a column

# Example usage:
awk 'BEGIN{s=0;}{s=s+$1;}END{print s/NR;}' input_file # Mean of column 1
# Change the 1 to the number of the column for which you want the mean
Source by maravelias.info #
 
PREVIOUS NEXT
Tagged: #bash #calculate #column
ADD COMMENT
Topic
Name
8+5 =