mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-26 06:17:01 +00:00
add awk
Subtract previous row values
This commit is contained in:
parent
2a299e123e
commit
6b27d3bd53
@ -499,6 +499,12 @@ awk '$1 ~ /^Linux/'
|
|||||||
awk ' {split( $0, a, "\t" ); asort( a ); for( i = 1; i <= length(a); i++ ) printf( "%s\t", a[i] ); printf( "\n" ); }'
|
awk ' {split( $0, a, "\t" ); asort( a ); for( i = 1; i <= length(a); i++ ) printf( "%s\t", a[i] ); printf( "\n" ); }'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Subtract previous row values (add column6 which equal to column4 minus last column5)
|
||||||
|
```bash
|
||||||
|
awk '{$6 = $4 - prev5; prev5 = $5; print;}'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Xargs
|
## Xargs
|
||||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||||
|
Loading…
Reference in New Issue
Block a user