The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

 crosstable -- Produce the crosstable from the 2 column data. Can also sum up a additional column by -3 switch option.

 2列のデータを度数を数えて、クロステーブルにする。
 Count the numbers of the frequencies of the combination of the 2 columns, and produce crosstable.
   

 オプション : 
   -i REGEX : 区切り文字の指定。コンマ , などに変更が可能。未指定ならタブ文字。Specify the delimiter. Default : tab
   -~   : 出力表の、縦軸と横軸を反転する。 (Transpose the output table btw. vertical and horizontal axis.)
   -=   : 入力の1行目を列名の並びと見なし、データの値とは扱わない。2行目からを加算対象のデータとして扱う。(Skip the 1st input line.)
   -1 str ; 出力の1行1列目に入れる文字列の指定。出力のレイアウトを見やすくのにも便利。 空文字列の指定には -1 '' とする。

   -+ N : N列目を残りの先頭2列の値の組合せごとに集計した値を出力する。Nは1始まり(Sum N-th column along the rest 2 first columns.)
   -^ N : 実際はおそらく -\^ で Nを指定。N列目の値を足すのではなくただ書き込む。実験的な実装。
   -@ N : N 秒ごとに,何行を読んだかを報告する。 Report how many have read every N seconds.

   -, N  : 出力表の各セルの値をN桁ごとにコンマで区切らない。 Put comma(,) in the numbers by every N digits, such as 12,345,678.
   -, 0  : 出力表の各セルの値を3桁ごとにコンマで区切らない。Not Put comma(,) in the numbers such as 12,345,678.
   -m N : 出力表において、N をかけ算した数の整数部を表示する。(Multiply number and take Integer part. E.g. N=1e-5)

   -d N : 出力の各セルにおいて、何桁で右詰めにするか。左側を空白文字でN桁になるまでは埋める。
   -0 STR : 出力表で埋まらないセルに埋める値。未指定なら 0。The value to be replaced on the unfilled output table cell.
   -v   : -+ が指定された場合に他の有用な情報も出力 (個数、空文字列) Other entailing information.
   -q   : 色を出さないようにする。 No color by ANSI color.

   -: FILE : 縦軸( -~ 指定なら横軸で) 集計されるべき項目(文字列)を指定する。FILEの中身に改行区切りで格納されているとする。

   -R 0 ; 通常は改行が\r\n のようになっている場合、\rの場合は除去している。この処理が不都合な場合にこのオプションで行わない。

 Ctrl+C に関して : 
   Try the following : 
     $0 <( yes 1 )  # This is a little different from " yes 1 | $0 " because not only "$0" but also "yes 1" stops by Ctrl +C. 

 関連するコマンド : 
   keyvalues 

 開発上のメモ :
   * 縦軸と横軸のそれぞれの表示順序を豊富にしても良さそう。
   * オプションスイッチが10個を超えたので、うまく整理したい。