【发布时间】:2019-06-28 14:11:05
【问题描述】:
我有两个文件,我想从中创建第三个文件,其中包含所有信息,每列由制表符分隔。
文件 1:
67 rule_ref: _avc ,output_tag: 'hello'
2 rule_ref: _cdf ,output_tag: 'hi'
334 rule_ref: _xyz ,output_tag: 'bye'
1 rule_ref: _abc ,output_tag: 'go'
文件 2:
rule_ref: _avc ,output_tag: 'hello' 1
rule_ref: _cdf ,output_tag: 'hi' 4
rule_ref: _xyz ,output_tag: 'bye' 5
并且想要一个 file3 这样:
67 1 rule_ref: _avc ,output_tag: 'hello'
2 4 rule_ref: _cdf ,output_tag: 'hi'
334 5 rule_ref: _xyz ,output_tag: 'bye'
1 0 rule_ref: _abc ,output_tag: 'go'
file1 的第 2 列与 file2 的第 1 列匹配,并且 file3 包含 file1 的第 1 列,file2 的第 2 列和 file1 的第 3 列。
我在谷歌上搜索,但没有找到任何结果来解决这个问题。请帮忙
【问题讨论】: