首页 > 其他 > 详细

awk合并两个文件

时间:2015-08-28 15:46:46      阅读:163      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!