当前位置: 技术问答>linux和unix
脚本编写的小问题
来源: 互联网 发布时间:2016-12-03
本文导语: 05/31/1113:05:05 1.9 103m 2848 05/31/1113:05:06 0 103m 2848 05/31/1113:05:07 0 103m 2848 05/31/1113:05:09 0 103m 2848 05/31/1113:05:10 0 103m 2848 05/31/1113:05:11 0 103m 2848 05/31/1113:05:13 2 103m 2848 05/31/1113:05:14 0 103m 2848 05/31/1113:05:15 0 103m ...
05/31/1113:05:05 1.9 103m 2848
05/31/1113:05:06 0 103m 2848
05/31/1113:05:07 0 103m 2848
05/31/1113:05:09 0 103m 2848
05/31/1113:05:10 0 103m 2848
05/31/1113:05:11 0 103m 2848
05/31/1113:05:13 2 103m 2848
05/31/1113:05:14 0 103m 2848
05/31/1113:05:15 0 103m 2848
05/31/1113:05:17 0 103m 2848
05/31/1113:05:18 3.9 103m 2848
05/31/1113:05:19 0 103m 2848
05/31/1113:05:21 2 103m 2848
460
455
455
455
455
455
455
455
455
455
455
455
455
上面两个分别是两个不同的文件,如何把下面的那一列放在上面的最后一列显示
awk '{print $1 $2 "t" $11 "t" " " "t" $7 "t" $8}' "$CURDIR/$1_record_$$.txt" >>"$file_name"
awk '{print $1}' "$CURDIR/$1_record_handle.txt" >>"$file_name"
上面的语句就是显示上面那两个文件的
05/31/1113:05:06 0 103m 2848
05/31/1113:05:07 0 103m 2848
05/31/1113:05:09 0 103m 2848
05/31/1113:05:10 0 103m 2848
05/31/1113:05:11 0 103m 2848
05/31/1113:05:13 2 103m 2848
05/31/1113:05:14 0 103m 2848
05/31/1113:05:15 0 103m 2848
05/31/1113:05:17 0 103m 2848
05/31/1113:05:18 3.9 103m 2848
05/31/1113:05:19 0 103m 2848
05/31/1113:05:21 2 103m 2848
460
455
455
455
455
455
455
455
455
455
455
455
455
上面两个分别是两个不同的文件,如何把下面的那一列放在上面的最后一列显示
awk '{print $1 $2 "t" $11 "t" " " "t" $7 "t" $8}' "$CURDIR/$1_record_$$.txt" >>"$file_name"
awk '{print $1}' "$CURDIR/$1_record_handle.txt" >>"$file_name"
上面的语句就是显示上面那两个文件的
|
直接用paste命令即可啊!
paste file1 file2
paste file1 file2