- 积分
- 1986
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-20
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
1 #csh
2 if (-e doc) rm -fr doc
3 mkdir doc
4 cp origin_file/tdump* ./
5 ls tdump* | sort > 1.csv
6 awk '{print substr($1,1,5),20substr($1,6,2),substr($1,8,2)+10-10,substr($1,10,2)+10-10,substr($1,12,2)+18-10}' 1.csv> tmp1.txt
7
8 awk '{if ($5<24) print $0}' tmp1.txt > tmp2.txt
9
10 awk '{if ($5>24) print $1,$2,$3,$4+1,$5-24}' tmp1.txt > tmp3.txt
11
12
13 awk '{if (($3>7 && $3%2==0 && $4<32) ||($3<8 && $3%2==1 && $4<32)) print $0}' tmp3.txt > tmp4.txt
14
15 awk '{if (($3>7 && $3%2==0 && $4==32) ||($3<8 && $3%2==1 && $4==32)) print $1,$2,$3+1,$4-31,$5}' tmp3.txt > tmp5.txt
16 awk '{if ($3>12) {print $1,$2+1,$3-12,$4,$5} else {print $1,$2,$3,$4,$5}}' tmp5.txt > tmp6.txt
17
18
19 awk '{if (($3==4 ||$3==6 ||$3==9 || $3==11) && $4<31) print $0}' tmp3.txt > tmp7.txt
20
21 awk '{if (($3==4 ||$3==6 ||$3==9 || $3==11) && $4==31) print $1,$2,$3+1,$4-30,$5}' tmp3.txt > tmp8.txt
22
23
24 awk '{if ($3==2 && $4<29) print $0}' tmp3.txt > tmp9.txt
25
26 awk '{if ($3==2 && $4>=29) print $0}' tmp3.txt > tmp10.txt
27 awk '{if (($2%4==0 && $2%100!=0) ||$2%400==0) print $0}' tmp10.txt > tmp11.txt
28
29 cat tmp11.txt tmp10.txt | sort | uniq -u | awk '{print $1,$2,$3+1,$4-28,$5}'> tmp12.txt
30
31 cat tmp2.txt tmp4.txt tmp6.txt tmp7.txt tmp8.txt tmp9.txt tmp11.txt tmp12.txt | sort | uniq > tmp13.txt
32
33 awk '{if ($3<10) {print $1,$2,"0"$3,$4,$5} else {print $1,$2,$3,$4,$5}}' tmp13.txt | \
34 awk '{if ($4<10) {print $1,$2,$3,"0"$4,$5} else {print $1,$2,$3,$4,$5}}' | \
35 awk '{if ($5<10) {print $1,$2,$3,$4,"0"$5} else {print $1,$2,$3,$4,$5}}' | \
36 awk '{print $1substr($2,3,2)$3$4$5}' | sort > tmp14.txt
37
38 set n = `cat 1.csv | wc -l`
39 echo $n
40 if ( -e file8) rm -rf file8
41 mkdir file8
42 @ i = 1
43 SO:
44 if ($i <= $n ) then
45 set nam1 = `cat 1.csv | sed -n ${i}p`
46 set nam2 = `cat tmp14.txt | sed -n ${i}p`
47 echo $nam1 $nam2 >> file8_test.txt
48 mv $nam1 ./file8/$nam2
49 @ i++
50 goto SO
51 endif
52 sort tmp14.txt > input_join.txt
53
54 rm *tmp*.txt
55 rm 1.csv
56
57
58
59 echo "************Success!*************"
|
|