1

私はいくつかのテキストを以下に示す表に解析したいと思います:

Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.35.195.1             -   0024.978a.d2d0  ARPA   FastEthernet0/0
Internet  10.35.195.2            73   0002.16a3.9e40  ARPA   FastEthernet0/0
Internet  10.35.195.12          130   0007.0e5b.861a  ARPA   FastEthernet0/0
Internet  10.35.195.14            1   000b.cdc9.7d11  ARPA   FastEthernet0/0
Internet  10.35.195.15            3   0021.5a7b.f2af  ARPA   FastEthernet0/0
Internet  10.35.195.16            0   000c.2909.2298  ARPA   FastEthernet0/0
Internet  10.35.195.17          112   0001.e6a2.5a90  ARPA   FastEthernet0/0
Internet  10.35.195.24          168   0050.564b.ebd4  ARPA   FastEthernet0/0

固定幅のテキスト入力があります。「Hardware Addr」などの一部のパラメータには、空白が含まれています。最初は Text::CSV::Slurp を使っていますが、セパレーターの定義が難しいです。だから私はあきらめます。

知りたいのですが、この入力をスムーズかつ効率的に処理できる perl モジュールまたは組み込みの perl コマンド (unpack、substr) はありますか?

4

1 に答える 1