- 论坛徽章:
- 0
|
若wrong.data 中内容为:
2011-04-02 4118341
2011-04-03 4793363
2011-05-21 9219468
2011-05-22 9002162
2011-05-23 6581796
2011-05-24 6562146
2011-05-25 6333302
2011-05-26 6596304
right.data中内容为:
2011-04-01 3685223
2011-04-02 4118341
2011-05-21 4612624
2011-05-22 4501081
2011-05-23 3290898
2011-05-24 3281073
2011-05-25 3166651
2011-05-26 3420550
想合并为以下内容
2011-04-01 3685223
2011-04-02 4118341 4118341
2011-05-21 4612624 9219468
2011-05-22 4501081 9002162
2011-05-23 3290898 6581796
2011-05-24 3281073 6562146
2011-05-25 3166651 6333302
2011-05-26 3420550 6596304
请问高手们如何实现?
awk ‘NR==FNR{a[$1]=$2}NR!=FNR{print $1,” “$2″ “a[$1]}’ wrong.data right.data 指令在solaris下无法实现合并。 |
|