If you’re on a beach holiday or just simply hanging out with your friends this summer, you might wanna chill and taste this bowl of ice cream exploding with tropical flavors.
Each serving has coconut ice cream, fresh sliced mangoes, coconut meat, pinipig and sticky rice all served in a coconut shell,of course I didn't try the dessert but it looks good.
Each serving has coconut ice cream, fresh sliced mangoes, coconut meat, pinipig and sticky rice all served in a coconut shell,of course I didn't try the dessert but it looks good.
马自达推出了一个“MAZDA3”原装配件“Selective Key Shell”,其实就是一个车匙护壳,颜色和马自达3真车相同颜色,马自达表示:即使您不在,也会感受到熟悉的MAZDA3![笑而不语]Soul Red Crystal Metallic和Machine Grey Premium Metallic价格为17280日元,Snowflake White Pearl Mica和Polymetal Grey Metallic价格为14040日元,“Selective Key Shell Box”(2160日元)将于7月发售。
#Linux[超话]# #Shell# #awk#
我有一个文件,格式形如:id,date1,date2,date3...dateN,每一行记录的是一个 id 以及对应的日期,日期可能有1个,也可能有3个,也可能有 N 个,总之是不确定个数的。如图一。
现在的需求是按照月份统计所有 id 出现的次数,每一行有几个日期就会产生对应的次数。
由于是文本文件,使用 awk 处理很方便,脚本如下:
awk -F',' '{for (i = 2;i<=NF;i++) a[substr($i,1,6)]+=1}END{for(i in a) print i,a[i]}' your_file
如图二,针对每一行内容,使用逗号分隔,从第2个元素开始【第1个是 id,无需处理】,依次把日期的前6位【年月】作为 key 来累加 id 出现的次数,每次加一即可。
统计输出结果如图三。
简单快捷,处理几百万行的数据也就几十秒。
我有一个文件,格式形如:id,date1,date2,date3...dateN,每一行记录的是一个 id 以及对应的日期,日期可能有1个,也可能有3个,也可能有 N 个,总之是不确定个数的。如图一。
现在的需求是按照月份统计所有 id 出现的次数,每一行有几个日期就会产生对应的次数。
由于是文本文件,使用 awk 处理很方便,脚本如下:
awk -F',' '{for (i = 2;i<=NF;i++) a[substr($i,1,6)]+=1}END{for(i in a) print i,a[i]}' your_file
如图二,针对每一行内容,使用逗号分隔,从第2个元素开始【第1个是 id,无需处理】,依次把日期的前6位【年月】作为 key 来累加 id 出现的次数,每次加一即可。
统计输出结果如图三。
简单快捷,处理几百万行的数据也就几十秒。
✋热门推荐