- 积分
- 1986
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-20
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 寒江雪(王训 于 2013-12-22 22:44 编辑
#csh# the contents of input.txt is like tdump10020100
#the contents of data.txt is like 2010-02-01 00:00, 3.3
awk '{print 20substr($1,6,2),substr($1,8,2)+10-10,substr($1,10,2)+10-10,substr($1,12,2)+10-10,$1}' input.txt | awk '{print $1"-"$2"-"$3"-"$4":00",$5}' | sort > 1.txt
awk -F "," '{print $1,$2}' data.txt | awk '{print $1"-"$2,$3}'| dos2unix | sort > 2.txt
join -a1 1.txt 2.txt >3.txt
awk '{print $1}' 3.txt | awk -F "-" '{print $1"-"$2"-"$3,$4}' > 4.txt
awk '{print $2,$3}' 3.txt > 5.txt
paste 4.txt 5.txt > output.txt
|
|