直线的秘密吧 关注:15贴子:6,021
#split -l 100000 --verbose 10y.csv |awk -F [\`] '{print $2}'


IP属地:北京17楼2015-11-03 20:14
回复
    awk '{a="NULL";getline a < "File2";print $0,a}' File1


    IP属地:北京19楼2015-11-05 14:58
    回复
      上面也是按列合并
      paste f1 f2 > f3


      IP属地:北京20楼2015-11-05 15:01
      回复
        select 6378.137*acos(sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon1/57.2958 - lon2/57.2958))
        from beatles_ods.order_info
        where concat(year,month,day) = '20151001'
        limit 1;
        经纬度 distance hive


        IP属地:北京21楼2015-11-11 19:57
        回复
          split -l 5000 --verbose 1109ss.txt suc_|awk -F [\`] '{name=substr($2,0,length($2)-1);print "mv " name " " name".txt"}'|bash


          IP属地:北京22楼2015-11-12 15:02
          回复

            http://www.cnblogs.com/solo/archive/2012/08/01/2618236.html
            gow windows下面的linux命令
            跟cygwin有一拼


            IP属地:北京23楼2015-11-12 18:46
            回复
              http://www.2cto.com/kf/201401/276088.html
              python时间


              IP属地:北京24楼2015-11-13 11:38
              回复
                select to_lat, to_lng, regexp_extract(to_lat, '([0-9]{2,3}\\.([0-9]{1,4}))',1), regexp_extract(to_lng, '([0-9]{2,3}\\.([0-9]{1,4}))',1) from beatles_ods.order_info limit 10;
                截取经纬度小数点后4位


                IP属地:北京25楼2015-11-23 15:10
                回复
                  if [ $driver_rownum -gt 100 -a $order_rownum -gt 100 -a $driver_rownum -lt 8000 -a $order_rownum -lt 150000 ]
                  then
                  echo '---->send mess'
                  rm ./scp.log -rf
                  ./scp_data.sh ${today_day} > ./scp.log
                  gnum=`grep 100 scp.log|wc -l|awk '{print $1}'`
                  num=0
                  while [ $num -lt 200 -a $gnum -lt 1 ]
                  do
                  sleep 5m
                  echo 'sleeo 5m'
                  let num++
                  ./scp_data.sh ${today_day} > ./scp.log
                  gnum=`grep 100 scp.log|wc -l|awk '{print $1}'`
                  done
                  echo '----> send success'
                  else
                  echo '---->data is not enough'
                  fi
                  通过log判断文件是否传送成功


                  IP属地:北京26楼2015-11-30 14:33
                  回复
                    ALTER TABLE test.fgq_kuacheng_driver change last_strive_time last_strive_time string COMMENT '最后一次抢单时间';


                    IP属地:北京28楼2015-12-08 11:35
                    回复
                      split -l 500000 --verbose sfc_passenger.txt suc_|awk -F [\"] '{name=substr($2,0,length($2));print "mv " name " " name".txt"}'|bash
                      切分文件,按照指定文件prefix名字


                      IP属地:北京29楼2016-01-07 13:47
                      回复
                        hive 计算经纬度距离
                        select 6378.137*acos(sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon1/57.2958 - lon2/57.2958))
                        from beatles_ods.order_info
                        where concat(year,month,day) = '20151001'
                        limit 1;


                        IP属地:北京30楼2016-01-11 12:00
                        回复
                          多任务 multask
                          #!/bin/sh
                          source /etc/profile
                          source ~/.bashrc
                          if [ $# == 2 ]; then
                          run_file=$1
                          run_day=$2
                          echo $run_file
                          echo $run_day
                          start_day=`echo ${run_day}|cut -d '-' -f 1|xargs -i date -d {} +%s`
                          echo $start_day
                          end_day=`echo ${run_day}|cut -d '-' -f 2|xargs -i date -d {} +%s`
                          echo $end_day
                          for((i=$start_day;i<= $end_day;i+=86400))
                          do
                          echo "nohup sh $run_file" `date -d @${i} +%Y%m%d` "> mul.log 2>&1 &"
                          echo "nohup sh $run_file" `date -d @${i} +%Y%m%d` "> mul.log 2>&1 &"|bash
                          done
                          fi


                          IP属地:北京31楼2016-01-11 19:15
                          回复
                            str="hello,world,i,like,you,babalala"
                            arr=(${str//,/ })
                            切分成数组
                            #号切掉左边的 %切掉右边的
                            ##全部 %%全部 单个的就是第一个#*rep %.* 注意符号放到表达是的左右
                            1、使用 # 号操作符。用途是从左边开始删除第一次出现子字符串即其左边字符,保留右边字符。用法为#*substr,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${str#*//}
                            得到的结果为www.你的域名.com/cut-string.html,即删除从左边开始到第一个"//"及其左边所有字符2、使用 ## 号操作符。用途是从左边开始删除最后一次出现子字符串即其左边字符,保留右边字符。用法为##*substr,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${str##*/}
                            得到的结果为cut-string.html,即删除最后出现的"/"及其左边所有字符
                            3、使用 % 号操作符。用途是从右边开始删除第一次出现子字符串即其右边字符,保留左边字符。用法为%substr*,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${str%/*}
                            得到的结果为http://www.你的域名.com,即删除从右边开始到第一个"/"及其右边所有字符
                            4、使用 %% 号操作符。用途是从右边开始删除最后一次出现子字符串即其右边字符,保留左边字符。用法为%%substr*,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${str%%/*}
                            得到的结果为http://www.你的域名.com,即删除从右边开始到最后一个"/"及其右边所有字符
                            第二种也分为四种,分别介绍如下:
                            1、从左边第几个字符开始以及字符的个数,用法为:start:len,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${var:0:5}
                            其中的 0 表示左边第一个字符开始,5 表示字符的总个数。
                            结果是:http:
                            2、从左边第几个字符开始一直到结束,用法为:start,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${var:7}
                            其中的 7 表示左边第8个字符开始
                            结果是:www.你的域名.com/cut-string.html
                            3、从右边第几个字符开始以及字符的个数,用法:0-start:len,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${str:0-15:10}
                            其中的 0-6 表示右边算起第6个字符开始,10 表示字符的个数。
                            结果是:cut-string
                            3、从右边第几个字符开始一直到结束,用法:0-start,例如:
                            str='http://www.你的域名.com/cut-string.html'
                            echo ${str:0-4}
                            其中的 0-6 表示右边算起第6个字符开始,10 表示字符的个数。
                            结果是:html
                            注:(左边的第一个字符是用 0 表示,右边的第一个字符用 0-1 表示)


                            IP属地:北京32楼2016-01-14 19:10
                            回复
                              while [ ! -f pinchetousu_${day}.csv ]
                              do
                              echo "file is not exist"
                              sleep 5m
                              done
                              if [ -f pinchetousu_${day}.csv -a -f pinchetousu_cal_${day}.csv ]
                              then
                              smail -t ssss -s 拼车问题统计及详情 -a pinchetousu_${day}.csv,pinchetousu_cal_${day}.csv
                              else
                              echo "send mail error, file is not exist"
                              fi
                              检测文件是否存在,如果不存在那么就睡觉,直到存在,然后发送邮件


                              IP属地:北京33楼2016-01-18 17:13
                              回复