-2
A
回答
1
Text::Table
和Text::ASCIITable
使兩個不同的輸出,後者有輪廓。我相信CPAN會有更多的懸掛。你也可以看看formats,這是Perl功能的一小部分,用於格式化報表。
+0
感謝Joel讓我解決這些模塊...... :) –
0
從CPAN,您可以使用Text::Table
0
假設你從現有的程序中想管的標準輸出爲其他格式,你可以用printf
創建一個名爲process.pl
#/bin/perl
use strict;
while (<>) {
my $unformatted_input = $_;
# Assuming you want to split on spaces, adjust if it is in fixed format.
my @elements = split/+/, $unformatted_input, 4;
# Printf format string, you can adjust lengths here. This would take
# an input of items in the elements array and make each file 10 characters
# See http://perldoc.perl.org/functions/sprintf.html for options
my $format_string='%10s%10s%10s%10s';
printf($format_string,@elements);
}
一個Perl腳本,做這樣的事情
然後,將您的標準輸出管道設置爲此,並將其格式化爲屏幕:
$ yourProcessThatDoesStdout | process.pl
相關問題
- 1. 自動生成的進口,從模塊
- 2. 自動生成表格
- 3. Perl:如何在腳本中生成'use'd模塊列表?
- 4. 更改perl模塊的默認源目錄模塊::生成
- 5. 在Perl中生成圖表
- 6. NullReferenceException與自動生成的表格
- 7. 分配時的Perl自動生成
- 8. 動態生成表格/從模型生成的動態表單/表單
- 9. 動態生成ng表格模板
- 10. 自動生成表格,並與jQuery
- 11. Perl使用Win32 :: OLE模塊Excel 2007-不能生成圖表
- 12. Excel VBA自動生成的php表格由php生成
- 13. 在PERL中使用自定義模塊
- 14. 在Perl中自動生成DBIx :: Class ORM中的對象
- 15. 生成模塊自身的出口鍵
- 16. 在Ubuntu中自動安裝基於軟件包的Perl模塊
- 17. 基於數據模型自動生成表格
- 18. 從CAKEPHP中的模型生成表格
- 19. 在Symfony中包含自動生成的管理模塊中的插槽
- 20. 自動生成需要來自節點模塊
- 21. 使用Perl自動生成數據庫模式和遷移
- 22. 如何從生成的模塊生成多模塊原型?
- 23. 在Perl的嚴格模式下使用動態生成的變量名稱
- 24. 在表格中添加自動完成
- 25. 在jquery中自動完成表格
- 26. jQuery中的動態表格生成
- 27. 生成動態網格在MVVM模式
- 28. 「模塊未找到」自動生成文件的流程錯誤
- 29. 咕嚕任務要自動生成文件的新模塊
- 30. 如何告訴Maven編譯自動生成的maven模塊?
只需使用'printf'。它是內置的,簡單的,它的工作原理。 – jordanm
你需要顯示你正在處理的數據類型,以及你需要的輸出 – Borodin