首页 > 系统服务 > 详细

01-01基于SHELL的数据分析

时间:2018-07-06 00:54:48      阅读:238      评论:0      收藏:0      [点我收藏+]


#!/usr/bin/env bash

for year in /root/Downloads/data/all/*

do
echo -ne `basename $year .gz`"\t"
gunzip -c $year | \
awk ‘{ temp = substr($0, 88, 5) + 0;
      q = substr($0, 93, 1);
      if (temp != 9999 && q ~ /[01459]/ && temp > max) max = temp }
END { print max }`
done

#!/usr/bin/env bash
for year in all/*
do
   echo -ne `basename $year .gz`"\t"
   gunzip -c $year | \
     awk ‘{ temp = substr($0, 88, 5) + 0;
            q = substr($0, 93, 1);
            if (temp !=9999 && q ~ /[01459]/ && temp > max) max = temp }
          END { print max }‘
done

01-01基于SHELL的数据分析

原文:https://www.cnblogs.com/gispathfinder/p/9270876.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!