diff --git a/README.md b/README.md index 2d0ad2b..cd389ad 100644 --- a/README.md +++ b/README.md @@ -447,12 +447,6 @@ awk 'BEGIN{OFS="\t"}$3="chr"$3' awk '!/bbo/' file ``` -##### Column subtraction - -```bash -cat file| awk -F '\t' 'BEGIN {SUM=0}{SUM+=$3-$2}END{print SUM}' -``` - ##### Usage and meaning of NR and FNR e.g. fileA: @@ -823,6 +817,18 @@ for line in $(cat myfile); do echo $line; read -n1; done ```bash factor 50 ``` +##### Sum up input list (e.g. seq 10) + +```bash +seq 10|paste -sd+|bc +``` + +##### Column subtraction + +```bash +cat file| awk -F '\t' 'BEGIN {SUM=0}{SUM+=$3-$2}END{print SUM}' +``` + ##### Simple math with expr ```bash @@ -852,6 +858,7 @@ echo "var=5;--var"| bc + ## Download [[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)] ##### Download all from a page @@ -1364,12 +1371,6 @@ echo $input seq 10 ``` -##### Sum up input list (e.g. seq 10) - -```bash -seq 10|paste -sd+|bc -``` - ##### Find average of input list/file ```bash