答案1
由 @manatwork 发布
{sub(/r.*/,"",$2); gsub(/[^[:digit:]]/,"",$2); print $2"|"$3"|"$4"|"$5}.
或者 gensub() 方式:
{print gensub(/[^[:digit:]]/,"","g",gensub(/r.*/,"",1,$2))"|"$3"|"$4"|"$5}
由 @manatwork 发布
{sub(/r.*/,"",$2); gsub(/[^[:digit:]]/,"",$2); print $2"|"$3"|"$4"|"$5}.
或者 gensub() 方式:
{print gensub(/[^[:digit:]]/,"","g",gensub(/r.*/,"",1,$2))"|"$3"|"$4"|"$5}