Horje
bash conditional sum Code Example
bash conditional sum
# Basic syntax:
awk '{ if ( condition ) { sum += $field; }} END { print sum }' your_file
# Where:
#	- $field is the field to sum if the condition is true

# Example usage:
# Sum all fields of column 5 in your_file that don't have "*" in field 3
awk '{ if ($3 != "*" ) { sum += $5; }} END { print sum }' your_file
# Note, explicitly setting your_file's field delimiter with 
#	"BEGIN { FS="<input_delimiter>" };" might be needed for non-standard 
#	delimiters
Source: www.unix.com




Shell

Related
how to install gitkraken on fedora Code Example how to install gitkraken on fedora Code Example
arch ocamlfuse Code Example arch ocamlfuse Code Example
npm ERR! Command failed: git clone --depth=1 -q -b 1.3.8 git://github.com/eligrey/FileSaver.js.git Code Example npm ERR! Command failed: git clone --depth=1 -q -b 1.3.8 git://github.com/eligrey/FileSaver.js.git Code Example
bash create symlink to symlinks Code Example bash create symlink to symlinks Code Example
snapd unavailable solved Code Example snapd unavailable solved Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
14