レポートを表形式で送信するためにPerlで書いていますが、データの入力が長すぎる場合は常に問題が発生します。行を複数に折り返すことができるようにコードを書く方法はありますか?これが私のコードと出力です。ありがとう!
printf "\n%-${max1}s %-${max2}s %-15s\n", "====", "====", "=====" ;
printf "%-${max1}s %-${max2}s %-15s\n", "Code", "Item", "Group" ;
printf "%-${max1}s %-${max2}s %-15s\n", "====", "====", "=====" ;
foreach my $f (@{$rpt_ptr}) {
printf "%-${max1}s %-${max2}s %-15s\n", "$$f{code}", "$$f{item}", "$$f{group}",
}
アイテムリストが長すぎる場合、出力テーブルが長すぎます。つまり、次のようになります。
==== ===== =====
Code Item Group
==== ===== =====
A1011 aaaaaa, bbbbb, ccccc, ddddd, eeeee, fffff, ggggg, hhhhh, iiiii, jjjjjj, kkkkk, llll B
B101 cccccc A
私は次のようなテーブルを出すことができるかどうかについてアスペクトされています:
==== ===== =====
Code Item Group
==== ===== =====
A1011 aaaaaa, bbbbb, ccccc, ddddd, B
eeeee, fffff, ggggg, hhhhh,
iiiii, jjjjjj, kkkkk, llll
B101 cccccc A
どうすればそれを達成できますか?