これは awk を使用して達成できますか? 既存の列からデータを区切った新しい列を追加しようとしています。入力ファイルはタブ区切りのテキスト ファイルです。device-0、device-1 の列は、phone-0-1、phone-1-2 から派生した新しい列です。
入力:
category1 phone-0-1 working 0000 0000 new 0
category1 phone-1-2 working 0000 0000 new 0
category1 phone-2-4 working 0000 0000 new 0
category1 phone-3-5 working 0000 0000 new 0
category1 phone-4-6 working 0000 0000 new 0
出力:
category1 device-0 phone-0-1 working 0000 0000 new 0
category1 device-1 phone-1-2 working 0000 0000 new 0
category1 device-2 phone-2-4 working 0000 0000 new 0
category1 device-3 phone-3-5 working 0000 0000 new 0
category1 device-4 phone-4-6 working 0000 0000 new 0