68user's page 掲示板

Prev< No. 4582> Next  [最新発言に戻る] [過去ログ一覧]
No. 4582 # zsh 2006/04/19 (水) 18:42:38
>>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;
}
------

Prev< No. 4582> Next  [最新発言に戻る] [過去ログ一覧]