1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| # 现有如下内容较为凌乱的文本文件 test $ cat test Address[0] Metal3,pin 133.175:159.92 Address[1] Metal3,pin 112.38:159.92 Address[2] Metal3,pin 70.775:159.92 Address[3] Metal3,pin 41.655:159.92 DataIn[0] Metal3,pin 66.615:159.92 DataIn[1] Metal3,pin 37.495:159.92 DataIn[2] Metal3,pin 122.88:159.92 DataIn[3] Metal3,pin 95.74:159.92 DataOut[0] Metal3,pin 45.815:159.92 DataOut[1] Metal3,pin 79.095:159.92 DataOut[2] Metal3,pin 104.055:159.92 DataOut[3] Metal3,pin 62.46:159.92 MemReq Metal3,pin 108.215:159.92 RdWrBar Metal3,pin 87.415:159.92 clock Metal3,pin 74.935:159.92
# 列对齐 $ cat test | column -t Address[0] Metal3,pin 133.175:159.92 Address[1] Metal3,pin 112.38:159.92 Address[2] Metal3,pin 70.775:159.92 Address[3] Metal3,pin 41.655:159.92 DataIn[0] Metal3,pin 66.615:159.92 DataIn[1] Metal3,pin 37.495:159.92 DataIn[2] Metal3,pin 122.88:159.92 DataIn[3] Metal3,pin 95.74:159.92 DataOut[0] Metal3,pin 45.815:159.92 DataOut[1] Metal3,pin 79.095:159.92 DataOut[2] Metal3,pin 104.055:159.92 DataOut[3] Metal3,pin 62.46:159.92 MemReq Metal3,pin 108.215:159.92 RdWrBar Metal3,pin 87.415:159.92 clock Metal3,pin 74.935:159.92
# 将 ',' 和 ':' 也识别为分隔符 $ cat test | column -t -s ',: ' Address[0] Metal3 pin 133.175 159.92 Address[1] Metal3 pin 112.38 159.92 Address[2] Metal3 pin 70.775 159.92 Address[3] Metal3 pin 41.655 159.92 DataIn[0] Metal3 pin 66.615 159.92 DataIn[1] Metal3 pin 37.495 159.92 DataIn[2] Metal3 pin 122.88 159.92 DataIn[3] Metal3 pin 95.74 159.92 DataOut[0] Metal3 pin 45.815 159.92 DataOut[1] Metal3 pin 79.095 159.92 DataOut[2] Metal3 pin 104.055 159.92 DataOut[3] Metal3 pin 62.46 159.92 MemReq Metal3 pin 108.215 159.92 RdWrBar Metal3 pin 87.415 159.92 clock Metal3 pin 74.935 159.92
|