爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5021|回复: 3

批量处理hysplit输出文件从UTM 到UTM+8

[复制链接]

新浪微博达人勋

发表于 2013-12-22 00:00:25 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
#csh
rm *.txt
rm -rf copy
mkdir copy
ls tdump* | sort > 1.csv
awk '{print substr($1,1,5),substr($1,6,2)+10-10,substr($1,8,2)+10-10,substr($1,10,2)+10-10,substr($1,12,2)+18-10}' 1.csv> tmp.txt
awk '{print substr($1,1,5),substr($1,6,2)+10-10,substr($1,8,2)+10-10,substr($1,10,2)+10-10,substr($1,12,2)+10-10}' 1.csv> c_tmp.txt

awk '{if ($5>23) {print $1,$2,$3,$4+1,$5-24} else print $0 }' tmp.txt > tmp1.txt
awk '{if ($5>23) {print $1,$2,$3,$4+1,$5-24} else print $0 }' c_tmp.txt > c_tmp1.txt

awk '{if ($3<8) {print $0}}' tmp1.txt | awk '{if ($3%2==1) print $0}'> tmp31.txt
awk '{if ($3<8) {print $0}}' c_tmp1.txt | awk '{if ($3%2==1) print $0}'> c_tmp31.txt

awk '{if ($3>7) {print $0}}' tmp1.txt | awk '{if ($3%2==0) print $0}'>> tmp31.txt
awk '{if ($3>7) {print $0}}' c_tmp1.txt | awk '{if ($3%2==0) print $0}'>> c_tmp31.txt

awk '{if ($3<8 && $3>2) {print $0}}' tmp1.txt | awk '{if ($3%2==0) print $0}'> tmp30.txt
awk '{if ($3<8 && $3>2) {print $0}}' c_tmp1.txt | awk '{if ($3%2==0) print $0}'> c_tmp30.txt

awk '{if ($3>7) {print $0}}' tmp1.txt | awk '{if ($3%2==1) print $0}'>> tmp30.txt
awk '{if ($3>7) {print $0}}' c_tmp1.txt | awk '{if ($3%2==1) print $0}'>> c_tmp30.txt

awk '{if ($3==02) {print $0}}' tmp1.txt > tmp28.txt
awk '{if ($3==02) {print $0}}' c_tmp1.txt > c_tmp28.txt

awk '{if($4 >31) {print $1,$2,$3+1,$4-31,$5} else{ print $1,$2,$3,$4,$5}}' tmp31.txt> tmp2.txt
awk '{if($4 >31) {print $1,$2,$3+1,$4-31,$5} else{ print $1,$2,$3,$4,$5}}' c_tmp31.txt> c_tmp2.txt

awk '{if($4 >30) {print $1,$2,$3+1,$4-30,$5} else{ print $1,$2,$3,$4,$5}}' tmp30.txt>> tmp2.txt
awk '{if($4 >30) {print $1,$2,$3+1,$4-30,$5} else{ print $1,$2,$3,$4,$5}}' c_tmp30.txt>> c_tmp2.txt

awk '{if($4 >28) {print $1,$2,$3+1,$4-28,$5} else{ print $1,$2,$3,$4,$5}}' tmp28.txt>> tmp2.txt
awk '{if($4 >28) {print $1,$2,$3+1,$4-28,$5} else{ print $1,$2,$3,$4,$5}}' c_tmp28.txt>> c_tmp2.txt

awk '{if($3 >12) {print $1,$2+1,$3-12,$4,$5} else{ print $1,$2,$3,$4,$5}}' tmp2.txt> tmp3.txt
awk '{if($3 >12) {print $1,$2+1,$3-12,$4,$5} else{ print $1,$2,$3,$4,$5}}' c_tmp2.txt> c_tmp3.txt

awk '{if ($2 < 10) {print $1"0"$2,$3,$4,$5} else {print $1$2,$3,$4,$5} }' tmp3.txt  > tmp4.txt
awk '{if ($2 < 10) {print $1"0"$2,$3,$4,$5} else {print $1$2,$3,$4,$5} }' c_tmp3.txt  > c_tmp4.txt

awk '{if ($2 < 10) {print $1"0"$2,$3,$4} else print $1$2,$3,$4}' tmp4.txt >tmp5.txt  
awk '{if ($2 < 10) {print $1"0"$2,$3,$4} else print $1$2,$3,$4}' c_tmp4.txt >c_tmp5.txt  

awk '{if ($2 < 10) {print $1"0"$2,$3} else {print $1$2,$3} }' tmp5.txt  > tmp6.txt
awk '{if ($2 < 10) {print $1"0"$2,$3} else {print $1$2,$3} }' c_tmp5.txt  > c_tmp6.txt

awk '{if ($2 < 10) {print $1"0"$2} else {print $1$2} }' tmp6.txt > fl.txt
awk '{if ($2 < 10) {print $1"0"$2} else {print $1$2} }' c_tmp6.txt > c_fl.txt
set n = `cat 1.csv | wc -l`
echo $n
@ i = 1
SO:
if ($i <= $n ) then
set nam1 = `cat c_fl.txt | sed -n ${i}p`
set nam2 = `cat fl.txt | sed -n ${i}p`
echo $nam1 $nam2 >> test.txt
mv $nam1 copy/$nam2
@ i++
goto SO
endif




密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-12-22 09:47:38 | 显示全部楼层
好东西,谢谢了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-6-26 16:47:36 | 显示全部楼层
没看懂,能给介绍一下子么?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-5-5 13:39:11 | 显示全部楼层
谢谢,可以下来试试
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表