>>4581 べた 適当に直してみました。 ------ BEGIN{ FS=","; chk_col=11; } { str_head_1=$1; if($chk_col ~ /:/) { str_head_2=head_string(chk_col); split_num=split($chk_col, str_foot, ":"); for (i=1; i<=split_num; i++) { for (j=chk_col+1; j<=NF; j++) { split($j, col_buf, ":"); str_foot[i]=sprintf("%s,%s", str_foot[i], col_buf[i]); } print str_head_1 "," i "," str_head_2 "," str_foot[i]; } } else { str_head_2=head_string(NF); print str_head_1 ",1," str_head_2; } } function head_string(chk_point) { str_buf=$3; for (k=3; k<chk_point; k++) { str_buf=sprintf("%s,%s", str_buf, $k); } return str_buf; } ------ |