감동, 마음이 움직이는 것
[linux] awk 본문
How to use "awk" (it is really cool!)
1. When you want to make a new file from data file with several fields:
awk '{print $1, $3}' simulation.d > total.d
2. If you want to extract certain conditioned field:
awk
'$1>100 && $1<1 {print $0}'
total.d > data.d
3. When you want to sum up the elements in the column:
awk 'x+=$2 {print x}' data.d
4. line number: you can print line number "NR"
awk '{print NR $2}' data.d
'Tips (Utility, Computer Language, and etc.)' 카테고리의 다른 글
[gawk] float calculation for awk (0) | 2016.09.19 |
---|---|
[sort] using command line and c++ function (0) | 2016.09.19 |
[Linux] Effectively delete a lot of files in a directory (0) | 2016.09.17 |
[Slurm] How to use (1) | 2016.09.16 |
[Latex] Multirow, Multicolumn in table (+cline) (0) | 2016.09.15 |