码迷,mamicode.com
首页 > 其他好文 > 详细

awk合并两个文件

时间:2015-08-28 15:48:44      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

awk 合并两个文件:

awk ‘NR==FNR{a[i]=$0;i++}NR>FNR{print a[j]"    "$0;j++}‘ template interface > interface_last

template:

Template Log tqt_url-response-code
Template Log tqt_url-response-code
Template Log tqt_url-response-code
Template Log tqt_url-response-code
Template Log tqt_url-response-code
Template Log tqt_url-response-code
Template Log tqt_url-response-code

interface:

app_interface.php_2xx
app_interface.php_3xx
app_interface.php_4xx
app_interface.php_5xx
app_interface.php_avgrt
app_interface.php_count
app_interface.php_total_time

interface_last 内容如下:

Template Log tqt_url-response-code    app_interface.php_2xx


awk合并两个文件

标签:

原文地址:http://my.oschina.net/moonly/blog/498635

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!