我想处理形式的字符串:
PREFIX_TYPE_N,DATA
那么,*awk (gawk, mawk, nawk) 是否支持在已匹配字符串的操作中包含模式匹配?像这样的东西(当然,对我不起作用):
*awk 'BEGIN { FS="," }
/PREFIX/ {
/TYPE_1/ {printf "[TYPE1] [DATA: $2]"} // <-- included pattern
/TYPE_2/ {printf "[TYPE2] [DATA: $2]"} // <-- another included pattern
... // <-- some more included patterns
}' "filename"
还是我还需要 if/else 或 switch/case?