0
我需要從任意數量的文件中提取第一列,並使用空行爲缺失的條目列顯示列。空行部分有問題。像這樣:使用AWK提取和填充列
File1:
Alfa Something More stuff
Charlie Something More stuff
Delta Something More stuff
Echo Something More stuff
Foxtrot Something More stuff
File2:
Alfa Something More stuff
Bravo Something More stuff
Echo Something More stuff
Foxtrot Something More stuff
File3:
Alfa Something More stuff
Bravo Something More stuff
Charlie Something More stuff
Delta Something More stuff
Echo Something More stuff
Output:
FileName1 FileName2 FileName3
========= ========= =========
Alfa Alfa Alfa
Bravo Bravo
Charlie Charlie
Delta Delta
Echo Echo Echo
Foxtrot Foxtrot
該腳本將獲取頭部和右列的長度,但列完全充滿空白。 – user287424 2012-08-14 02:17:20
奇怪的是,我沒有看到與我的測試。這是與GNU Awk 4.0.1。 – 2012-08-14 02:22:25
解決了它。默認情況下,我在Debian上使用mawk。指定的gawk,它的工作原理。排序全部混亂,但很容易重新排序。什麼導致了未分類? – user287424 2012-08-14 02:40:34