内容简介:Miller 5.3.0 已发布,Miller 是一个类似 sed、awk、cut、join 和 sort 工具,用来处理基于命名索引的数据,如 CSV、TSV 和 tabular JSON 。 该版本包括文档改进和 bug 修复,以及如下特性: Comment strings ...
Miller 5.3.0 已发布,Miller 是一个类似 sed、awk、cut、join 和 sort 工具,用来处理基于命名索引的数据,如 CSV、TSV 和 tabular JSON 。
该版本包括文档改进和 bug 修复,以及如下特性:
Comment strings in data files:
mlr --skip-comments
allows you to filter out input lines starting with#
, for all file formats. Likewise,mlr --skip-comments-with X
lets you specify the comment-stringX
. Comments are only supported at start of data line.mlr --pass-comments
andmlr --pass-comments-with X
allow you to forward comments to program output as they are read.The count-similar verb lets you compute cluster sizes by cluster labels.
While Miller DSL arithmetic gracefully overflows from 64-integer to double-precision float (see also here), there are now the integer-preserving arithmetic operators
.+
.-
.*
./
.//
for those times when you want integer overflow.There is a new bitcount function: for example,
echo x=0xf0000206 | mlr put '$y=bitcount($x)'
producesx=0xf0000206,y=7
.Issue 158:
mlr -T
is an alias for--nidx --fs tab
, andmlr -t
is an alias formlr --tsvlite
.The mathematical constants π and e have been renamed from
PI
andE
toM_PI
andM_E
, respectively. (It's annoying to get a syntax error when you try to define a variable namedE
in the DSL, whenA
throughD
work just fine.) This is a backward incompatibility, but not enough of us to justify calling this release Miller 6.0.0.
下载地址:
效果示例:
before
county,tiv_2011,tiv_2012,line,construction SEMINOLE,22890.55,20848.71,Residential,Wood MIAMI DADE,1158674.85,1076001.08,Residential,Masonry PALM BEACH,1174081.5,1856589.17,Residential,Masonry MIAMI DADE,2850980.31,2650932.72,Commercial,Reinforced Masonry HIGHLANDS,23006.41,19757.91,Residential,Wood HIGHLANDS,49155.16,47362.96,Residential,Wood DUVAL,1731888.18,2785551.63,Residential,Masonry ST. JOHNS,29589.12,35207.53,Residential,Wood
after
$ mlr --icsv --opprint --barred \ put '$tiv_delta = $tiv_2012 - $tiv_2011; unset $tiv_2011, $tiv_2012' \ then sort -nr tiv_delta flins.csv +------------+-------------+----------------+ | county | line | tiv_delta | +------------+-------------+----------------+ | Duval | Residential | 1053663.450000 | | Palm Beach | Residential | 682507.670000 | | St. Johns | Residential | 5618.410000 | | Highlands | Residential | -1792.200000 | | Seminole | Residential | -2041.840000 | | Highlands | Residential | -3248.500000 | | Miami Dade | Residential | -82673.770000 | | Miami Dade | Commercial | -200047.590000 | +------------+-------------+----------------+
【声明】文章转载自:开源中国社区 [http://www.oschina.net]
以上所述就是小编给大家介绍的《Miller 5.3.0 发布,CSV 和 JSON 处理工具》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Python编程初学者指南
[美]Michael Dawson / 王金兰 / 人民邮电出版社 / 2014-10-1
Python是一种解释型、面向对象、动态数据类型的高级程序设计语言。Python可以用于很多的领域,从科学计算到游戏开发。 《Python编程初学者指南》尝试以轻松有趣的方式来帮助初学者掌握Python语言和编程技能。《Python编程初学者指南》共12章,每一章都会用一个完整的游戏来演示其中的关键知识点,并通过编写好玩的小软件这种方式来学习编程,引发读者的兴趣,降低学习的难度。每章最后都会......一起来看看 《Python编程初学者指南》 这本书的介绍吧!