This commit is contained in:
John Kerl 2020-07-26 21:25:55 -04:00
parent e19754f1c6
commit 7721194378
6 changed files with 10 additions and 23 deletions

View file

@ -32,6 +32,7 @@ The following are full docsets as of the specified release:
<li/> <a href="/miller-releases/miller-5.5.0/doc/index.html">Miller 5.5.0</a>
<li/> <a href="/miller-releases/miller-5.4.0/doc/index.html">Miller 5.4.0</a>
<li/> <a href="/miller-releases/miller-5.3.0/doc/index.html">Miller 5.3.0</a>
<!--
<li/> <a href="/miller-releases/miller-5.2.0/doc/index.html">Miller 5.2.0</a>
<li/> <a href="/miller-releases/miller-5.1.0/doc/index.html">Miller 5.1.0</a>
<li/> <a href="/miller-releases/miller-5.0.0/doc/index.html">Miller 5.0.0</a>
@ -63,5 +64,5 @@ The following are full docsets as of the specified release:
<li/> <a href="/miller-releases/miller-2.0.0/doc/index.html">Miller 2.0.0</a>
<li/> <a href="/miller-releases/miller-1.0.1/doc/index.html">Miller 1.0.1</a>
<li/> <a href="/miller-releases/miller-1.0.0/doc/index.html">Miller 1.0.0</a>
-->
</ul>

View file

@ -2389,7 +2389,7 @@ SEE ALSO
2020-07-06 MILLER(1)
2020-07-19 MILLER(1)
</pre>
</div>
<p/>

View file

@ -2315,4 +2315,4 @@ SEE ALSO
2020-07-06 MILLER(1)
2020-07-19 MILLER(1)

View file

@ -2,12 +2,12 @@
.\" Title: mlr
.\" Author: [see the "AUTHOR" section]
.\" Generator: ./mkman.rb
.\" Date: 2020-07-06
.\" Date: 2020-07-19
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "MILLER" "1" "2020-07-06" "\ \&" "\ \&"
.TH "MILLER" "1" "2020-07-19" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Portability definitions
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -98,6 +98,7 @@ The following are full docsets as of the specified release:
<li/> <a href="/miller-releases/miller-5.5.0/doc/index.html">Miller 5.5.0</a>
<li/> <a href="/miller-releases/miller-5.4.0/doc/index.html">Miller 5.4.0</a>
<li/> <a href="/miller-releases/miller-5.3.0/doc/index.html">Miller 5.3.0</a>
<!--
<li/> <a href="/miller-releases/miller-5.2.0/doc/index.html">Miller 5.2.0</a>
<li/> <a href="/miller-releases/miller-5.1.0/doc/index.html">Miller 5.1.0</a>
<li/> <a href="/miller-releases/miller-5.0.0/doc/index.html">Miller 5.0.0</a>
@ -129,7 +130,7 @@ The following are full docsets as of the specified release:
<li/> <a href="/miller-releases/miller-2.0.0/doc/index.html">Miller 2.0.0</a>
<li/> <a href="/miller-releases/miller-1.0.1/doc/index.html">Miller 1.0.1</a>
<li/> <a href="/miller-releases/miller-1.0.0/doc/index.html">Miller 1.0.0</a>
-->
</ul>
<!-- ================================================================ -->

View file

@ -56,18 +56,14 @@ func handle(fileName string, includeFields []string) (ok bool) {
return false
} else {
// 0.030s
// Line to map
// Note: needs to have insertion-ordering
mymap := make(map[string]string)
fields := strings.Split(line, ",");
for _, field := range(fields) {
kvps := strings.SplitN(field, "=", 2)
mymap[kvps[0]] = kvps[1]
}
// 0.220s
// delta 0.190s
// 27%
// Map-to-map transform
newmap := make(map[string]string)
@ -77,9 +73,6 @@ func handle(fileName string, includeFields []string) (ok bool) {
newmap[includeField] = value
}
}
// 0.280s
// delta 0.060s
// 9%
// Map to string
outs := make([]string, len(newmap))
@ -88,21 +81,13 @@ func handle(fileName string, includeFields []string) (ok bool) {
outs[i] = k + "=" + v
i++
}
// 0.320s
// delta 0.040s
// 6%
out := strings.Join(outs, ",")
// 0.330s
// delta 0.010s
// 2%
// Write to output stream
//fmt.Println("")
writer.WriteString(out)
// delta 0.390s
// 56%
writer.WriteString("\n")
}
}
if fileName != "-" {