1. 用","當作分隔,取出某一欄位
cat *.csv | awk -V FS="," '{print $11}'
2. 比較某一欄的值是否大於或小於某個值
使用方法: cat *.txt | awk -f max.awk
BEGIN {
max = 0.005;
min = -0.005;
FS="[,]";
}
{
if (FNR > 1) {
if ($11>max) {
# print NR; -->印出行號
print $0; -->印出該行內容
}
if ($11<min) {
# print NR;
print $0;
}
}
}
END {
printf("max = %f min = %f ", max,min);
}
3. grep comparison results
grep -A 2 Pass */*diff.cmp.txt | grep % | awk -F "|" '{print $5}' | xargs
沒有留言:
張貼留言