这可以使用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