mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-25 08:53:55 +00:00
example neaten
This commit is contained in:
parent
81f6bd4910
commit
2f65f03f44
2 changed files with 10 additions and 12 deletions
|
|
@ -817,13 +817,12 @@ $ cat data/maxrows.mlr
|
|||
@maxn = max(@maxn, $n);
|
||||
|
||||
# After all records have been read, loop through retained records
|
||||
# and print those with the max n value
|
||||
# and print those with the max n value.
|
||||
end {
|
||||
for ((nr,k),v in @records) {
|
||||
if (k == "n") {
|
||||
if (@records[nr]["n"] == @maxn) {
|
||||
emit @records[nr]
|
||||
}
|
||||
for (int nr in @records) {
|
||||
map record = @records[nr];
|
||||
if (record["n"] == @maxn) {
|
||||
emit record;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
@maxn = max(@maxn, $n);
|
||||
|
||||
# After all records have been read, loop through retained records
|
||||
# and print those with the max n value
|
||||
# and print those with the max n value.
|
||||
end {
|
||||
for ((nr,k),v in @records) {
|
||||
if (k == "n") {
|
||||
if (@records[nr]["n"] == @maxn) {
|
||||
emit @records[nr]
|
||||
}
|
||||
for (int nr in @records) {
|
||||
map record = @records[nr];
|
||||
if (record["n"] == @maxn) {
|
||||
emit record;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue