字符扫描的AWK小段
时间:2006-01-09 来源:cellar
田田写的,还没仔细看,先记下来再说:
sed -n '/ccy=人民币/,/ccy=/p' AI3408030201 > AI34
这里-n是只输出明确要求打印"p"的部分
awk -F= ' $1=="itm" { printf $2 } $1=="dbt_bal" { printf "\t"$2 } $1=="crd_bal" { print "\t"$2 } ' AI34
vim a.sh
$1==48544 {print $2}
$1==48545 {print $2}
$1==48546 {print $2}
$1==48547 {print $2}
$1==48548 {print $2}
$1==48549 {print $2}
$1==48552 {print $2}
$1==48553 {print $2}
$1==48554 {print $2}
$1==48555 {print $2}
$1==48556 {print $2}
$1==48557 {print $2}
$1==48558 {print $2}
$1==48559 {print $2}
$1==48105 {print $2}
$1==49200 {print $2}
$1==49201 {print $2}
$1==49202 {print $2}
$1==49203 {print $2}
$1==49204 {print $2}
$1==49100 {print $2}
$1==49101 {print $2}
$1==57103 {print $2}
sed 's/,//' AI34.1 |awk -f a.sh | awk ' { a+=$1 } END { printf("%-16.2f\n", a) } '