- 论坛徽章:
- 0
|
回复 1# fangww_uestc
试了一下,这样是可以的
administrator@:~/shell/1xanalysis$ awk 'BEGIN{var=sprintf("%.4f",113.163402 ;print var,113.23456}'
113.1634 113.235
但在程序却出现了错误
awk: cmd. line:10: /^Time:.*Qua/{ lat2=$7; lon2=$11; k+=1;if(k==1){ lon1=$11; lat1=$7}; cmd1=getjw(lon1,lat1,lon2,lat2);lat=sprintf("%.4f,(lat2+lat1)/2);lon=(lon2+lon1)/2}\
awk: cmd. line:10: ^ unterminated string
awk: cmd. line:10: /^Time:.*Qua/{ lat2=$7; lon2=$11; k+=1;if(k==1){ lon1=$11; lat1=$7}; cmd1=getjw(lon1,lat1,lon2,lat2);lat=sprintf("%.4f,(lat2+lat1)/2);lon=(lon2+lon1)/2}\
awk: cmd. line:10: ^ syntax error
就是把lat=(lat2+lat1)/2改为lat=sprintf("%.4f,(lat2+lat1)/2" ,怎么出现了错误了呢
|
|