题解 | #格式化输出#
格式化输出
https://www.nowcoder.com/practice/d91a06bfaff443928065e611b14a0e95
#!/bin/bash awk 'BEGIN{FS=""}{fg1=NF%3 if(NF<4) {print $0} else {for(i=1;i<=NF;i++) {if(i%3==fg1&&i!=NF) {printf "%s,",$i} else {printf "%s",$i}} print ""}}' nowcoder