0
点赞
收藏
分享

微信扫一扫

Calculate difference between consecutive data points in a column from a file

罗蓁蓁 2023-11-06 阅读 44

 

 

cat > temp001
5
10
12
6
9
12
5

 awk 'p{print $0-p}{p=$0}' temp001
5
2
-6
3
3
-7

 

REF:

https://www.unix.com/shell-programming-and-scripting/130727-how-subtract-adjacent-lines-single-column.html

 



举报

相关推荐

0 条评论