Update README.md

This commit is contained in:
onceupon 2017-12-12 10:59:35 +08:00 committed by GitHub
parent 83a7ff99be
commit 08bf087b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -522,12 +522,6 @@ detail here: http://stackoverflow.com/questions/33408762/bash-turning-single-c
awk '{split($2,a,",");for(i in a)print $1"\t"a[i]}' file awk '{split($2,a,",");for(i in a)print $1"\t"a[i]}' file
``` ```
##### Sum up a file (each line in file contains only one number)
```bash
awk '{s+=$1} END {print s}' filename
```
##### Average a file (each line in file contains only one number) ##### Average a file (each line in file contains only one number)
```bash ```bash
awk '{s+=$1}END{print s/NR}' awk '{s+=$1}END{print s/NR}'
@ -823,6 +817,13 @@ factor 50
seq 10|paste -sd+|bc seq 10|paste -sd+|bc
``` ```
##### Sum up a file (each line in file contains only one number)
```bash
awk '{s+=$1} END {print s}' filename
```
##### Column subtraction ##### Column subtraction
```bash ```bash