mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 18:25:45 +00:00
Compare commits
No commits in common. "main" and "v6.15.0" have entirely different histories.
44 changed files with 165 additions and 405 deletions
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
|
|
@ -36,11 +36,11 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89
|
||||
uses: github/codeql-action/init@df559355d593797519d70b90fc8edd5db049e7a2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
|
|
@ -51,7 +51,7 @@ jobs:
|
|||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89
|
||||
uses: github/codeql-action/autobuild@df559355d593797519d70b90fc8edd5db049e7a2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
|
@ -65,4 +65,4 @@ jobs:
|
|||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89
|
||||
uses: github/codeql-action/analyze@df559355d593797519d70b90fc8edd5db049e7a2
|
||||
|
|
|
|||
4
.github/workflows/codespell.yml
vendored
4
.github/workflows/codespell.yml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
|||
steps:
|
||||
# Check out the code base
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||
fetch-depth: 0
|
||||
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
# Run linter against code base
|
||||
# https://github.com/codespell-project/codespell
|
||||
- name: Codespell
|
||||
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
|
||||
uses: codespell-project/actions-codespell@406322ec52dd7b488e48c1c4b82e2a8b3a1bf630
|
||||
with:
|
||||
check_filenames: true
|
||||
ignore_words_file: .codespellignore
|
||||
|
|
|
|||
6
.github/workflows/go.yml
vendored
6
.github/workflows/go.yml
vendored
|
|
@ -15,10 +15,10 @@ jobs:
|
|||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
|
||||
with:
|
||||
go-version: 1.24
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ jobs:
|
|||
if: matrix.os == 'windows-latest'
|
||||
run: mkdir -p bin/${{matrix.os}} && cp mlr.exe bin/${{matrix.os}}
|
||||
|
||||
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
|
||||
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: mlr-${{matrix.os}}
|
||||
path: bin/${{matrix.os}}/*
|
||||
|
|
|
|||
29
.github/workflows/release-snap.yaml
vendored
29
.github/workflows/release-snap.yaml
vendored
|
|
@ -1,29 +0,0 @@
|
|||
name: Release for Snap
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
snap:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Build snap
|
||||
uses: snapcore/action-build@v1
|
||||
id: build
|
||||
|
||||
- name: Publish to Snap Store
|
||||
uses: snapcore/action-publish@v1
|
||||
env:
|
||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
with:
|
||||
snap: ${{ steps.build.outputs.snap }}
|
||||
# release: stable # or edge, beta, candidate
|
||||
release: stable
|
||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: Release for GitHub
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
|
|
@ -17,19 +17,19 @@ jobs:
|
|||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# https://github.com/marketplace/actions/cache
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7
|
||||
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
|
|
@ -40,7 +40,7 @@ jobs:
|
|||
|
||||
# https://goreleaser.com/ci/actions/
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a
|
||||
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552
|
||||
#if: startsWith(github.ref, 'refs/tags/v')
|
||||
with:
|
||||
version: latest
|
||||
|
|
|
|||
28
.github/workflows/test-snap-can-build.yml
vendored
28
.github/workflows/test-snap-can-build.yml
vendored
|
|
@ -1,28 +0,0 @@
|
|||
name: 🧪 Snap Builds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
pull_request:
|
||||
branches: '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: snapcore/action-build@v1
|
||||
id: build
|
||||
|
||||
- uses: diddlesnaps/snapcraft-review-action@v1
|
||||
with:
|
||||
snap: ${{ steps.build.outputs.snap }}
|
||||
isClassic: 'false'
|
||||
# Plugs and Slots declarations to override default denial (requires store assertion to publish)
|
||||
# plugs: ./plug-declaration.json
|
||||
# slots: ./slot-declaration.json
|
||||
|
|
@ -95,14 +95,13 @@ So, in broad overview, the key packages are:
|
|||
|
||||
* Miller dependencies are all in the Go standard library, except two:
|
||||
* GOCC lexer/parser code-generator from [github.com/goccmack/gocc](https://github.com/goccmack/gocc):
|
||||
* Forked at [github.com/johnkerl/gocc](github.com/johnkerl/gocc).
|
||||
* This package defines the grammar for Miller's domain-specific language (DSL) for the Miller `put` and `filter` verbs. And, GOCC is a joy to use. :)
|
||||
* It is used on the terms of its open-source license.
|
||||
* [golang.org/x/term](https://pkg.go.dev/golang.org/x/term):
|
||||
* Just a one-line Miller callsite for is-a-terminal checking for the [Miller REPL](./pkg/terminals/repl/README.md).
|
||||
* It is used on the terms of its open-source license.
|
||||
* See also [./go.mod](go.mod). Setup:
|
||||
* `go get github.com/johnkerl/gocc`
|
||||
* `go get github.com/goccmack/gocc`
|
||||
* `go get golang.org/x/term`
|
||||
|
||||
### Miller per se
|
||||
|
|
|
|||
11
README.md
11
README.md
|
|
@ -46,18 +46,22 @@ key-value-pair data in a variety of data formats.
|
|||
* [Active issues](https://github.com/johnkerl/miller/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
|
||||
|
||||
# Installing
|
||||
|
||||
There's a good chance you can get Miller pre-built for your system:
|
||||
|
||||
[](https://launchpad.net/ubuntu/+source/miller)
|
||||
[](https://launchpad.net/ubuntu/xenial/+package/miller)
|
||||
[](https://packages.fedoraproject.org/pkgs/miller/miller/)
|
||||
[](https://packages.debian.org/stable/miller)
|
||||
[](https://packages.gentoo.org/packages/sys-apps/miller)
|
||||
|
||||
[](http://www.pro-linux.de/cgi-bin/DBApp/check.cgi?ShowApp..20427.100)
|
||||
[](https://aur.archlinux.org/packages/miller-git)
|
||||
|
||||
[](http://pkgsrc.se/textproc/miller)
|
||||
[](https://www.freshports.org/textproc/miller/)
|
||||
|
||||
[](https://anaconda.org/conda-forge/miller/)
|
||||
[](https://snapcraft.io/miller)
|
||||
[](https://formulae.brew.sh/formula/miller)
|
||||
[](https://www.macports.org/ports.php?by=name&substr=miller)
|
||||
[](https://chocolatey.org/packages/miller)
|
||||
|
|
@ -65,7 +69,7 @@ There's a good chance you can get Miller pre-built for your system:
|
|||
|
||||
|OS|Installation command|
|
||||
|---|---|
|
||||
|Linux|`yum install miller`<br/> `apt-get install miller`<br/> `snap install miller`|
|
||||
|Linux|`yum install miller`<br/> `apt-get install miller`|
|
||||
|Mac|`brew install miller`<br/>`port install miller`|
|
||||
|Windows|`choco install miller`<br/>`winget install Miller.Miller`<br/>`scoop install main/miller`|
|
||||
|
||||
|
|
@ -91,7 +95,6 @@ See also [building from source](https://miller.readthedocs.io/en/latest/build.ht
|
|||
[](https://github.com/johnkerl/miller/actions/workflows/go.yml)
|
||||
[](https://github.com/johnkerl/miller/actions/workflows/codeql-analysis.yml)
|
||||
[](https://github.com/johnkerl/miller/actions/workflows/codespell.yml)
|
||||
[](https://github.com/johnkerl/miller/actions/workflows/test-snap-can-build.yml)
|
||||
<!--
|
||||
[](https://github.com/johnkerl/miller/actions/workflows/release.yml)
|
||||
-->
|
||||
|
|
@ -110,7 +113,7 @@ See also [building from source](https://miller.readthedocs.io/en/latest/build.ht
|
|||
* Without `make`:
|
||||
* To build: `go build github.com/johnkerl/miller/v6/cmd/mlr`.
|
||||
* To run tests: `go test github.com/johnkerl/miller/v6/pkg/...` and `mlr regtest`.
|
||||
* To install: `go install github.com/johnkerl/miller/v6/cmd/mlr@latest` will install to _GOPATH_`/bin/mlr`.
|
||||
* To install: `go install github.com/johnkerl/miller/v6/cmd/mlr` will install to _GOPATH_`/bin/mlr`.
|
||||
* See also the doc page on [building from source](https://miller.readthedocs.io/en/latest/build).
|
||||
* For more developer information please see [README-dev.md](./README-dev.md).
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ mkdir -p $dir
|
|||
# ----------------------------------------------------------------
|
||||
# Run the parser-generator
|
||||
|
||||
# Build the bin/gocc executable (use my fork for performance):
|
||||
# get github.com/goccmack/gocc
|
||||
go get github.com/johnkerl/gocc
|
||||
# Build the bin/gocc executable:
|
||||
go get github.com/goccmack/gocc
|
||||
#go get github.com/johnkerl/gocc
|
||||
bingocc="$GOPATH/bin/gocc"
|
||||
|
||||
if [ ! -x "$bingocc" ]; then
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module one
|
||||
|
||||
go 1.24
|
||||
go 1.16
|
||||
|
||||
toolchain go1.24.5
|
||||
require github.com/goccmack/gocc v0.0.0-20210322175033-34358ebe5808 // indirect
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
github.com/goccmack/gocc v0.0.0-20210322175033-34358ebe5808 h1:MBgZdx/wBJWTR2Q79mQfP6c8uXdQiu5JowfEz3KhFac=
|
||||
github.com/goccmack/gocc v0.0.0-20210322175033-34358ebe5808/go.mod h1:dWhnuKE5wcnGTExA2DH6Iicu21YnWwOPMrc/GyhtbCk=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
|
@ -28,9 +28,9 @@ mkdir -p $dir
|
|||
# ----------------------------------------------------------------
|
||||
# Run the parser-generator
|
||||
|
||||
# Build the bin/gocc executable (use my fork for performance):
|
||||
# go get github.com/goccmack/gocc
|
||||
go get github.com/johnkerl/gocc
|
||||
# Build the bin/gocc executable:
|
||||
go get github.com/goccmack/gocc
|
||||
#go get github.com/johnkerl/gocc
|
||||
bingocc="$GOPATH/bin/gocc"
|
||||
if [ ! -x "$bingocc" ]; then
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module two
|
||||
|
||||
go 1.24
|
||||
go 1.16
|
||||
|
||||
toolchain go1.24.5
|
||||
require github.com/goccmack/gocc v0.0.0-20210322175033-34358ebe5808 // indirect
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
github.com/goccmack/gocc v0.0.0-20210322175033-34358ebe5808 h1:MBgZdx/wBJWTR2Q79mQfP6c8uXdQiu5JowfEz3KhFac=
|
||||
github.com/goccmack/gocc v0.0.0-20210322175033-34358ebe5808/go.mod h1:dWhnuKE5wcnGTExA2DH6Iicu21YnWwOPMrc/GyhtbCk=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
|
@ -26,7 +26,7 @@ Vertical-tabular format is good for a quick look at CSV data layout -- seeing wh
|
|||
<b>wc -l data/flins.csv</b>
|
||||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
36635 data/flins.csv
|
||||
36635 data/flins.csv
|
||||
</pre>
|
||||
|
||||
<pre class="pre-highlight-in-pair">
|
||||
|
|
@ -227,7 +227,7 @@ Peek at the data:
|
|||
<b>wc -l data/colored-shapes.dkvp</b>
|
||||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
10078 data/colored-shapes.dkvp
|
||||
10078 data/colored-shapes.dkvp
|
||||
</pre>
|
||||
|
||||
<pre class="pre-highlight-in-pair">
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ date,qoh
|
|||
<b>wc -l data/miss-date.csv</b>
|
||||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
1372 data/miss-date.csv
|
||||
1372 data/miss-date.csv
|
||||
</pre>
|
||||
|
||||
Since there are 1372 lines in the data file, some automation is called for. To find the missing dates, you can convert the dates to seconds since the epoch using `strptime`, then compute adjacent differences (the `cat -n` simply inserts record-counters):
|
||||
|
|
|
|||
|
|
@ -757,14 +757,12 @@ Notes:
|
|||
within the input.
|
||||
--pass-comments-with {string}
|
||||
Immediately print commented lines within input, with
|
||||
specified prefix. For CSV input format, the prefix
|
||||
must be a single character.
|
||||
specified prefix.
|
||||
--skip-comments Ignore commented lines (prefixed by `#`) within the
|
||||
input.
|
||||
--skip-comments-with {string}
|
||||
Ignore commented lines within input, with specified
|
||||
prefix. For CSV input format, the prefix must be a
|
||||
single character.
|
||||
prefix.
|
||||
</pre>
|
||||
|
||||
Examples:
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ Using a package manager:
|
|||
* MacOS: `brew update` and `brew install miller`, or `sudo port selfupdate` and `sudo port install miller`, depending on your preference of [Homebrew](https://brew.sh) or [MacPorts](https://macports.org).
|
||||
* Windows: `choco install miller` using [Chocolatey](https://chocolatey.org).
|
||||
* Note: Miller 6 was released 2022-01-09; [several platforms](https://github.com/johnkerl/miller/blob/main/README-versions.md) may have Miller 5 available.
|
||||
* As of Miller 6.16.0, you can do `snap install miller`. Note however that the executable is named `miller`, _not_ `mlr`. See also [https://snapcraft.io/miller](https://snapcraft.io/miller).
|
||||
|
||||
See also:
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ Using a package manager:
|
|||
* MacOS: `brew update` and `brew install miller`, or `sudo port selfupdate` and `sudo port install miller`, depending on your preference of [Homebrew](https://brew.sh) or [MacPorts](https://macports.org).
|
||||
* Windows: `choco install miller` using [Chocolatey](https://chocolatey.org).
|
||||
* Note: Miller 6 was released 2022-01-09; [several platforms](https://github.com/johnkerl/miller/blob/main/README-versions.md) may have Miller 5 available.
|
||||
* As of Miller 6.16.0, you can do `snap install miller`. Note however that the executable is named `miller`, _not_ `mlr`. See also [https://snapcraft.io/miller](https://snapcraft.io/miller).
|
||||
|
||||
See also:
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
insertion-ordered hash map. This encompasses a variety of data
|
||||
formats, including but not limited to the familiar CSV, TSV, and JSON.
|
||||
(Miller can handle positionally-indexed data as a special case.) This
|
||||
manpage documents mlr 6.16.0.
|
||||
manpage documents mlr 6.15.0.
|
||||
|
||||
1mEXAMPLES0m
|
||||
mlr --icsv --opprint cat example.csv
|
||||
|
|
@ -255,14 +255,12 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
within the input.
|
||||
--pass-comments-with {string}
|
||||
Immediately print commented lines within input, with
|
||||
specified prefix. For CSV input format, the prefix
|
||||
must be a single character.
|
||||
specified prefix.
|
||||
--skip-comments Ignore commented lines (prefixed by `#`) within the
|
||||
input.
|
||||
--skip-comments-with {string}
|
||||
Ignore commented lines within input, with specified
|
||||
prefix. For CSV input format, the prefix must be a
|
||||
single character.
|
||||
prefix.
|
||||
|
||||
1mCOMPRESSED-DATA FLAGS0m
|
||||
Miller offers a few different ways to handle reading data files
|
||||
|
|
@ -1288,7 +1286,7 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1mhaving-fields0m
|
||||
|
|
@ -1926,7 +1924,7 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1mstats10m
|
||||
|
|
@ -2075,7 +2073,7 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1msummary0m
|
||||
|
|
@ -3759,5 +3757,5 @@ This is simply a copy of what you should see on running `man mlr` at a command p
|
|||
MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
|
||||
https://miller.readthedocs.io
|
||||
|
||||
2026-01-02 4mMILLER24m(1)
|
||||
2025-08-14 4mMILLER24m(1)
|
||||
</pre>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
insertion-ordered hash map. This encompasses a variety of data
|
||||
formats, including but not limited to the familiar CSV, TSV, and JSON.
|
||||
(Miller can handle positionally-indexed data as a special case.) This
|
||||
manpage documents mlr 6.16.0.
|
||||
manpage documents mlr 6.15.0.
|
||||
|
||||
1mEXAMPLES0m
|
||||
mlr --icsv --opprint cat example.csv
|
||||
|
|
@ -234,14 +234,12 @@
|
|||
within the input.
|
||||
--pass-comments-with {string}
|
||||
Immediately print commented lines within input, with
|
||||
specified prefix. For CSV input format, the prefix
|
||||
must be a single character.
|
||||
specified prefix.
|
||||
--skip-comments Ignore commented lines (prefixed by `#`) within the
|
||||
input.
|
||||
--skip-comments-with {string}
|
||||
Ignore commented lines within input, with specified
|
||||
prefix. For CSV input format, the prefix must be a
|
||||
single character.
|
||||
prefix.
|
||||
|
||||
1mCOMPRESSED-DATA FLAGS0m
|
||||
Miller offers a few different ways to handle reading data files
|
||||
|
|
@ -1267,7 +1265,7 @@
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1mhaving-fields0m
|
||||
|
|
@ -1905,7 +1903,7 @@
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1mstats10m
|
||||
|
|
@ -2054,7 +2052,7 @@
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1msummary0m
|
||||
|
|
@ -3738,4 +3736,4 @@
|
|||
MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
|
||||
https://miller.readthedocs.io
|
||||
|
||||
2026-01-02 4mMILLER24m(1)
|
||||
2025-08-14 4mMILLER24m(1)
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ Notes:
|
|||
**Flags:**
|
||||
|
||||
* `--pass-comments`: Immediately print commented lines (prefixed by `#`) within the input.
|
||||
* `--pass-comments-with {string}`: Immediately print commented lines within input, with specified prefix. For CSV input format, the prefix must be a single character.
|
||||
* `--pass-comments-with {string}`: Immediately print commented lines within input, with specified prefix.
|
||||
* `--skip-comments`: Ignore commented lines (prefixed by `#`) within the input.
|
||||
* `--skip-comments-with {string}`: Ignore commented lines within input, with specified prefix. For CSV input format, the prefix must be a single character.
|
||||
* `--skip-comments-with {string}`: Ignore commented lines within input, with specified prefix.
|
||||
|
||||
## Compressed-data flags
|
||||
|
||||
|
|
|
|||
|
|
@ -1465,7 +1465,7 @@ See also the `sub` and `ssub` verbs.
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
</pre>
|
||||
|
||||
|
|
@ -3214,7 +3214,7 @@ the old string, like the `ssub` DSL function. See also the `gsub` and `sub` verb
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
</pre>
|
||||
|
||||
|
|
@ -3720,7 +3720,7 @@ See also the `gsub` and `ssub` verbs.
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
</pre>
|
||||
|
||||
|
|
@ -4134,7 +4134,7 @@ There are two main ways to use `mlr uniq`: the first way is with `-g` to specify
|
|||
<b>wc -l data/colored-shapes.csv</b>
|
||||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
10079 data/colored-shapes.csv
|
||||
10079 data/colored-shapes.csv
|
||||
</pre>
|
||||
|
||||
<pre class="pre-highlight-in-pair">
|
||||
|
|
@ -4291,7 +4291,7 @@ color=purple,shape=square,flag=0
|
|||
<b>wc -l data/repeats.dkvp</b>
|
||||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
57 data/repeats.dkvp
|
||||
57 data/repeats.dkvp
|
||||
</pre>
|
||||
|
||||
<pre class="pre-highlight-in-pair">
|
||||
|
|
|
|||
14
go.mod
14
go.mod
|
|
@ -14,22 +14,22 @@ module github.com/johnkerl/miller/v6
|
|||
// Local development:
|
||||
// replace github.com/johnkerl/lumin => /Users/kerl/git/johnkerl/lumin
|
||||
|
||||
go 1.24.0
|
||||
go 1.24.5
|
||||
|
||||
require (
|
||||
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb
|
||||
github.com/johnkerl/lumin v1.0.0
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||
github.com/klauspost/compress v1.18.3
|
||||
github.com/klauspost/compress v1.18.0
|
||||
github.com/kshedden/statmodel v0.0.0-20210519035403-ee97d3e48df1
|
||||
github.com/lestrrat-go/strftime v1.1.1
|
||||
github.com/mattn/go-isatty v0.0.20
|
||||
github.com/nine-lives-later/go-windows-terminal-sequences v1.0.4
|
||||
github.com/pkg/profile v1.7.0
|
||||
github.com/stretchr/testify v1.11.1
|
||||
golang.org/x/sys v0.40.0
|
||||
golang.org/x/term v0.39.0
|
||||
golang.org/x/text v0.33.0
|
||||
github.com/stretchr/testify v1.10.0
|
||||
golang.org/x/sys v0.35.0
|
||||
golang.org/x/term v0.34.0
|
||||
golang.org/x/text v0.28.0
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
@ -39,7 +39,7 @@ require (
|
|||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
|
||||
github.com/kshedden/dstream v0.0.0-20190512025041-c4c410631beb // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
golang.org/x/tools v0.40.0 // indirect
|
||||
golang.org/x/tools v0.35.0 // indirect
|
||||
gonum.org/v1/gonum v0.16.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
|
|
|||
24
go.sum
24
go.sum
|
|
@ -17,8 +17,8 @@ github.com/johnkerl/lumin v1.0.0 h1:CV34cHZOJ92Y02RbQ0rd4gA0C06Qck9q8blOyaPoWpU=
|
|||
github.com/johnkerl/lumin v1.0.0/go.mod h1:eLf5AdQOaLvzZ2zVy4REr/DSeEwG+CZreHwNLICqv9E=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
||||
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
|
||||
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/kshedden/dstream v0.0.0-20190512025041-c4c410631beb h1:Z5BVHFk/DLOIUAd2NycF0mLtKfhl7ynm4Uy5+AFhT48=
|
||||
github.com/kshedden/dstream v0.0.0-20190512025041-c4c410631beb/go.mod h1:+U+6yzfITr4/teU2YhxWhdyw6YzednT/16/UBMjlDrU=
|
||||
github.com/kshedden/statmodel v0.0.0-20210519035403-ee97d3e48df1 h1:UyIQ1VTQq/0CS/wLYjf3DV6uRKTd1xcsng3BccM4XCY=
|
||||
|
|
@ -39,18 +39,18 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
|
||||
golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
|
||||
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
|
||||
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
||||
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
|
||||
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
|
||||
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
||||
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
||||
golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=
|
||||
golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
insertion-ordered hash map. This encompasses a variety of data
|
||||
formats, including but not limited to the familiar CSV, TSV, and JSON.
|
||||
(Miller can handle positionally-indexed data as a special case.) This
|
||||
manpage documents mlr 6.16.0.
|
||||
manpage documents mlr 6.15.0.
|
||||
|
||||
1mEXAMPLES0m
|
||||
mlr --icsv --opprint cat example.csv
|
||||
|
|
@ -234,14 +234,12 @@
|
|||
within the input.
|
||||
--pass-comments-with {string}
|
||||
Immediately print commented lines within input, with
|
||||
specified prefix. For CSV input format, the prefix
|
||||
must be a single character.
|
||||
specified prefix.
|
||||
--skip-comments Ignore commented lines (prefixed by `#`) within the
|
||||
input.
|
||||
--skip-comments-with {string}
|
||||
Ignore commented lines within input, with specified
|
||||
prefix. For CSV input format, the prefix must be a
|
||||
single character.
|
||||
prefix.
|
||||
|
||||
1mCOMPRESSED-DATA FLAGS0m
|
||||
Miller offers a few different ways to handle reading data files
|
||||
|
|
@ -1267,7 +1265,7 @@
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1mhaving-fields0m
|
||||
|
|
@ -1905,7 +1903,7 @@
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1mstats10m
|
||||
|
|
@ -2054,7 +2052,7 @@
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
1msummary0m
|
||||
|
|
@ -3738,4 +3736,4 @@
|
|||
MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
|
||||
https://miller.readthedocs.io
|
||||
|
||||
2026-01-02 4mMILLER24m(1)
|
||||
2025-08-14 4mMILLER24m(1)
|
||||
|
|
|
|||
18
man/mlr.1
18
man/mlr.1
|
|
@ -2,12 +2,12 @@
|
|||
.\" Title: mlr
|
||||
.\" Author: [see the "AUTHOR" section]
|
||||
.\" Generator: ./mkman.rb
|
||||
.\" Date: 2026-01-02
|
||||
.\" Date: 2025-08-14
|
||||
.\" Manual: \ \&
|
||||
.\" Source: \ \&
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "MILLER" "1" "2026-01-02" "\ \&" "\ \&"
|
||||
.TH "MILLER" "1" "2025-08-14" "\ \&" "\ \&"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Portability definitions
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
@ -47,7 +47,7 @@ on integer-indexed fields: if the natural data structure for the latter is the
|
|||
array, then Miller's natural data structure is the insertion-ordered hash map.
|
||||
This encompasses a variety of data formats, including but not limited to the
|
||||
familiar CSV, TSV, and JSON. (Miller can handle positionally-indexed data as
|
||||
a special case.) This manpage documents mlr 6.16.0.
|
||||
a special case.) This manpage documents mlr 6.15.0.
|
||||
.SH "EXAMPLES"
|
||||
.sp
|
||||
|
||||
|
|
@ -291,14 +291,12 @@ Notes:
|
|||
within the input.
|
||||
--pass-comments-with {string}
|
||||
Immediately print commented lines within input, with
|
||||
specified prefix. For CSV input format, the prefix
|
||||
must be a single character.
|
||||
specified prefix.
|
||||
--skip-comments Ignore commented lines (prefixed by `#`) within the
|
||||
input.
|
||||
--skip-comments-with {string}
|
||||
Ignore commented lines within input, with specified
|
||||
prefix. For CSV input format, the prefix must be a
|
||||
single character.
|
||||
prefix.
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
|
|
@ -1586,7 +1584,7 @@ See also the `sub` and `ssub` verbs.
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
.fi
|
||||
.if n \{\
|
||||
|
|
@ -2410,7 +2408,7 @@ the old string, like the `ssub` DSL function. See also the `gsub` and `sub` verb
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
.fi
|
||||
.if n \{\
|
||||
|
|
@ -2583,7 +2581,7 @@ See also the `gsub` and `ssub` verbs.
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
.fi
|
||||
.if n \{\
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Summary: Name-indexed data processing tool
|
||||
Name: miller
|
||||
Version: 6.16.0
|
||||
Version: 6.15.0
|
||||
Release: 1%{?dist}
|
||||
License: BSD
|
||||
Source: https://github.com/johnkerl/miller/releases/download/%{version}/miller-%{version}.tar.gz
|
||||
|
|
@ -36,9 +36,6 @@ make install
|
|||
%{_mandir}/man1/mlr.1*
|
||||
|
||||
%changelog
|
||||
* Fri Jan 2 2026 John Kerl <kerl.john.r@gmail.com> - 6.16.0-1
|
||||
- 6.16.0 release
|
||||
|
||||
* Thu Aug 14 2025 John Kerl <kerl.john.r@gmail.com> - 6.15.0-1
|
||||
- 6.15.0 release
|
||||
|
||||
|
|
|
|||
|
|
@ -979,7 +979,9 @@ var FileFormatFlagSection = FlagSection{
|
|||
name: "--ojsonl",
|
||||
help: "Use JSON Lines format for output data.",
|
||||
parser: func(args []string, argc int, pargi *int, options *TOptions) {
|
||||
options.WriterOptions.OutputFileFormat = "jsonl"
|
||||
options.WriterOptions.OutputFileFormat = "json"
|
||||
options.WriterOptions.WrapJSONOutputInOuterList = false
|
||||
options.WriterOptions.JSONOutputMultiline = false
|
||||
*pargi += 1
|
||||
},
|
||||
},
|
||||
|
|
@ -1146,7 +1148,9 @@ var FileFormatFlagSection = FlagSection{
|
|||
altNames: []string{"--l2l"},
|
||||
parser: func(args []string, argc int, pargi *int, options *TOptions) {
|
||||
options.ReaderOptions.InputFileFormat = "json"
|
||||
options.WriterOptions.OutputFileFormat = "jsonl"
|
||||
options.WriterOptions.OutputFileFormat = "json"
|
||||
options.WriterOptions.WrapJSONOutputInOuterList = false
|
||||
options.WriterOptions.JSONOutputMultiline = false
|
||||
*pargi += 1
|
||||
},
|
||||
},
|
||||
|
|
@ -2674,7 +2678,7 @@ var CommentsInDataFlagSection = FlagSection{
|
|||
{
|
||||
name: "--skip-comments-with",
|
||||
arg: "{string}",
|
||||
help: "Ignore commented lines within input, with specified prefix. For CSV input format, the prefix must be a single character.",
|
||||
help: "Ignore commented lines within input, with specified prefix.",
|
||||
parser: func(args []string, argc int, pargi *int, options *TOptions) {
|
||||
CheckArgCount(args, *pargi, argc, 2)
|
||||
options.ReaderOptions.CommentString = args[*pargi+1]
|
||||
|
|
@ -2696,7 +2700,7 @@ var CommentsInDataFlagSection = FlagSection{
|
|||
{
|
||||
name: "--pass-comments-with",
|
||||
arg: "{string}",
|
||||
help: "Immediately print commented lines within input, with specified prefix. For CSV input format, the prefix must be a single character.",
|
||||
help: "Immediately print commented lines within input, with specified prefix.",
|
||||
parser: func(args []string, argc int, pargi *int, options *TOptions) {
|
||||
CheckArgCount(args, *pargi, argc, 2)
|
||||
options.ReaderOptions.CommentString = args[*pargi+1]
|
||||
|
|
|
|||
|
|
@ -39,11 +39,6 @@ func NewRecordReaderCSV(
|
|||
if len(readerOptions.IFS) != 1 {
|
||||
return nil, fmt.Errorf("for CSV, IFS can only be a single character")
|
||||
}
|
||||
if readerOptions.CommentHandling != cli.CommentsAreData {
|
||||
if len(readerOptions.CommentString) != 1 {
|
||||
return nil, fmt.Errorf("for CSV, the comment prefix must be a single character")
|
||||
}
|
||||
}
|
||||
return &RecordReaderCSV{
|
||||
readerOptions: readerOptions,
|
||||
ifs0: readerOptions.IFS[0],
|
||||
|
|
@ -331,7 +326,7 @@ func (reader *RecordReaderCSV) maybeConsumeComment(
|
|||
// its Write method has pointer receiver. So we have a WorkaroundBuffer
|
||||
// struct below which has non-pointer receiver.
|
||||
|
||||
// Contract with our fork of the go-csv CSV Reader, and, our own constructor.
|
||||
// Contract with our fork of the go-csv CSV Reader
|
||||
lib.InternalCodingErrorIf(len(csvRecord) != 1)
|
||||
recordsAndContexts.PushBack(types.NewOutputString(csvRecord[0], context))
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ func Create(writerOptions *cli.TWriterOptions) (IRecordWriter, error) {
|
|||
return NewRecordWriterDKVP(writerOptions)
|
||||
case "json":
|
||||
return NewRecordWriterJSON(writerOptions)
|
||||
case "jsonl":
|
||||
return NewRecordWriterJSONLines(writerOptions)
|
||||
case "md":
|
||||
return NewRecordWriterMarkdown(writerOptions)
|
||||
case "markdown":
|
||||
|
|
|
|||
|
|
@ -35,19 +35,6 @@ func NewRecordWriterJSON(writerOptions *cli.TWriterOptions) (*RecordWriterJSON,
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
func NewRecordWriterJSONLines(writerOptions *cli.TWriterOptions) (*RecordWriterJSON, error) {
|
||||
wopt := *writerOptions
|
||||
wopt.WrapJSONOutputInOuterList = false
|
||||
wopt.JSONOutputMultiline = false
|
||||
return &RecordWriterJSON{
|
||||
writerOptions: &wopt,
|
||||
jsonFormatting: mlrval.JSON_SINGLE_LINE,
|
||||
jvQuoteAll: writerOptions.JVQuoteAll,
|
||||
wroteAnyRecords: false,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
func (writer *RecordWriterJSON) Write(
|
||||
outrec *mlrval.Mlrmap,
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
// GRAMMAR FOR THE MILLER DOMAIN-SPECIFIC LANGUAGE
|
||||
//
|
||||
// This is the Miller DSL's BNF grammar, using the awesome GOCC tool framework
|
||||
// from https://github.com/goccmack/gocc (forked at https://github.com/johnkerl/gocc).
|
||||
// from https://github.com/goccmack/gocc.
|
||||
//
|
||||
// The first section is lexical elements and the second section is syntactical
|
||||
// elements. These are the analogs of lex and yacc, respectively, using a
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ func transformerSubUsage(
|
|||
fmt.Fprintf(o, "Options:\n")
|
||||
fmt.Fprintf(o, "-f {a,b,c} Field names to convert.\n")
|
||||
fmt.Fprintf(o, "-r {regex} Regular expression for field names to convert.\n")
|
||||
fmt.Fprintf(o, "-a Convert all fields.\n")
|
||||
fmt.Fprintf(o, "-a Convert all field names.\n")
|
||||
fmt.Fprintf(o, "-h|--help Show this message.\n")
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ func transformerGsubUsage(
|
|||
fmt.Fprintf(o, "Options:\n")
|
||||
fmt.Fprintf(o, "-f {a,b,c} Field names to convert.\n")
|
||||
fmt.Fprintf(o, "-r {regex} Regular expression for field names to convert.\n")
|
||||
fmt.Fprintf(o, "-a Convert all fields.\n")
|
||||
fmt.Fprintf(o, "-a Convert all field names.\n")
|
||||
fmt.Fprintf(o, "-h|--help Show this message.\n")
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ func transformerSsubUsage(
|
|||
fmt.Fprintf(o, "Options:\n")
|
||||
fmt.Fprintf(o, "-f {a,b,c} Field names to convert.\n")
|
||||
fmt.Fprintf(o, "-r {regex} Regular expression for field names to convert.\n")
|
||||
fmt.Fprintf(o, "-a Convert all fields.\n")
|
||||
fmt.Fprintf(o, "-a Convert all field names.\n")
|
||||
fmt.Fprintf(o, "-h|--help Show this message.\n")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ package version
|
|||
// Nominally things like "6.0.0" for a release, then "6.0.0-dev" in between.
|
||||
// This makes it clear that a given build is on the main dev branch, not a
|
||||
// particular snapshot tag.
|
||||
var STRING string = "6.16.0"
|
||||
var STRING string = "6.15.0"
|
||||
|
|
|
|||
150
snap/README.md
150
snap/README.md
|
|
@ -1,150 +0,0 @@
|
|||
# Failed attempts to create a snap interactively
|
||||
|
||||
2026-01-02 I used an Ubuntu 24.04 EC2 instance. I followed https://documentation.ubuntu.com/snapcraft/stable/. Error messages said things like
|
||||
|
||||
```
|
||||
A network related operation failed in a context of no network access.
|
||||
Recommended resolution: Verify that the environment has internet connectivity; see https://canonical-craft-providers.readthedocs-hosted.com/en/latest/explanation/ for further reference.
|
||||
Full execution log: '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20260102-170252.488632.log'
|
||||
```
|
||||
|
||||
when there was in fact no network problem. I remained confused.
|
||||
|
||||
```
|
||||
$ sudo snapcraft pack
|
||||
|
||||
$ lxc list
|
||||
|
||||
$ snapcraft pack --destructive-mode
|
||||
|
||||
$ snapcraft pack --use-multipass
|
||||
|
||||
$ sudo snap install multipass
|
||||
|
||||
$ snapcraft pack --use-multipass
|
||||
|
||||
$ sudo lxd init --auto
|
||||
|
||||
$ lxc network list
|
||||
|
||||
$ sudo snapcraft pack
|
||||
|
||||
$ sudo snap set snapcraft provider=multipass
|
||||
|
||||
$ sudo snapcraft pack --destructive-mode
|
||||
|
||||
[This created miller_6.15.0_arm64.snap]
|
||||
|
||||
$ snapcraft upload --release=stable *.snap
|
||||
No keyring found to store or retrieve credentials from.
|
||||
Recommended resolution: Ensure the keyring is working or SNAPCRAFT_STORE_CREDENTIALS is correctly exported into the environment
|
||||
For more information, check out: https://documentation.ubuntu.com/snapcraft/stable/how-to/publishing/authenticate
|
||||
Full execution log: '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20260102-172357.599171.log'
|
||||
|
||||
$ ll *.snap
|
||||
-rw-r--r-- 1 root root 8994816 Jan 2 17:22 miller_6.15.0_arm64.snap
|
||||
|
||||
$ snap install *.snap
|
||||
error: access denied (try with sudo)
|
||||
|
||||
$ sudo snap install *.snap
|
||||
error: cannot find signatures with metadata for snap/component "miller_6.15.0_arm64.snap"
|
||||
```
|
||||
|
||||
Conclusion:
|
||||
|
||||
* I got cryptic error messages with various permutations.
|
||||
* Through trial and error I got a `.snap` file with `sudo` and `multipass` and `--destructive-mode`.
|
||||
* Even then, I got a `.snap` file only for the current machine's arch, and the resulting `.snap` file was not locally installable.
|
||||
* This led me to try a GitHub Action.
|
||||
|
||||
# Info from Claude about auto-releasing
|
||||
|
||||
Here's how to set up automatic Snap publishing from GitHub releases:
|
||||
|
||||
## 1. Create snapcraft.yaml
|
||||
|
||||
First, ensure you have a proper `snapcraft.yaml` in your repo root (or in a `snap/` directory):
|
||||
|
||||
```yaml
|
||||
name: your-app-name
|
||||
base: core22 # or core24 for Ubuntu 24.04
|
||||
version: git # automatically uses git tags
|
||||
summary: Single-line summary
|
||||
description: |
|
||||
Longer description of your application
|
||||
|
||||
grade: stable # or devel
|
||||
confinement: strict # or classic, devmode
|
||||
|
||||
apps:
|
||||
your-app-name:
|
||||
command: bin/your-binary
|
||||
plugs:
|
||||
- home
|
||||
- network
|
||||
|
||||
parts:
|
||||
your-app:
|
||||
plugin: nil # change based on your build system (go, python, etc.)
|
||||
source: .
|
||||
# Add build steps as needed
|
||||
```
|
||||
|
||||
## 2. Get Snapcraft credentials
|
||||
|
||||
Export your Snapcraft login credentials:
|
||||
|
||||
```bash
|
||||
snapcraft export-login --snaps=miller --channels=stable,candidate,beta,edge snapcraft-token.txt
|
||||
```
|
||||
|
||||
This creates a token file with limited permissions for just your snap.
|
||||
|
||||
## 3. Add token to GitHub Secrets
|
||||
|
||||
1. Go to your GitHub repo → Settings → Secrets and variables → Actions
|
||||
2. Click "New repository secret"
|
||||
3. Name: `SNAPCRAFT_TOKEN`
|
||||
4. Value: Paste the entire contents of `snapcraft-token.txt`
|
||||
|
||||
## 4. Create GitHub Action workflow
|
||||
|
||||
Create `.github/workflows/release.yml`:
|
||||
|
||||
```yaml
|
||||
name: Release to Snap Store
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
snap:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build snap
|
||||
uses: snapcore/action-build@v1
|
||||
id: build
|
||||
|
||||
- name: Publish to Snap Store
|
||||
uses: snapcore/action-publish@v1
|
||||
env:
|
||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
with:
|
||||
snap: ${{ steps.build.outputs.snap }}
|
||||
# release: stable # or edge, beta, candidate
|
||||
release: edge
|
||||
```
|
||||
|
||||
## Tips
|
||||
|
||||
- **Version handling**: Using `version: git` in snapcraft.yaml automatically uses your git tag as the version
|
||||
- **Channels**: Start with `edge` channel for testing, then promote to `stable` once confident
|
||||
- **Multiple architectures**: Add a build matrix if you need to support arm64, etc.
|
||||
- **Testing before stable**: Consider publishing to `candidate` or `beta` first, then manually promote to `stable` after testing
|
||||
|
||||
Now when you create a GitHub release with a tag (e.g., `v1.0.0`), the workflow will automatically build and publish your snap!
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
name: miller
|
||||
base: core24
|
||||
version: git
|
||||
summary: Miller is like awk, sed, cut, join and sort
|
||||
description: |
|
||||
Miller is like awk, sed, cut, join, and sort for data formats such as CSV, TSV, JSON, JSON Lines, and positionally-indexed.
|
||||
|
||||
grade: stable
|
||||
confinement: strict
|
||||
|
||||
adopt-info: miller
|
||||
|
||||
website: https://github.com/johnkerl/miller/issues
|
||||
contact: https://github.com/johnkerl/miller/issues
|
||||
issues: https://github.com/johnkerl/miller/issues
|
||||
source-code: https://github.com/johnkerl/miller
|
||||
|
||||
license: BSD-2-Clause
|
||||
compression: lzo
|
||||
|
||||
platforms:
|
||||
amd64:
|
||||
build-on: [amd64]
|
||||
build-for: [amd64]
|
||||
arm64:
|
||||
build-on: [arm64]
|
||||
build-for: [arm64]
|
||||
armhf:
|
||||
build-on: [armhf]
|
||||
build-for: [armhf]
|
||||
s390x:
|
||||
build-on: [s390x]
|
||||
build-for: [s390x]
|
||||
ppc64el:
|
||||
build-on: [ppc64el]
|
||||
build-for: [ppc64el]
|
||||
|
||||
apps:
|
||||
miller:
|
||||
command: usr/local/bin/mlr
|
||||
plugs:
|
||||
- home
|
||||
|
||||
parts:
|
||||
miller:
|
||||
source: https://github.com/johnkerl/miller
|
||||
source-type: git
|
||||
plugin: make
|
||||
build-snaps:
|
||||
- go
|
||||
|
||||
override-pull: |
|
||||
craftctl default
|
||||
craftctl set version="$(git describe --tags | sed 's/^v//' | cut -d "-" -f1)"
|
||||
|
|
@ -393,7 +393,7 @@ See also the `sub` and `ssub` verbs.
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
================================================================
|
||||
|
|
@ -1062,7 +1062,7 @@ the old string, like the `ssub` DSL function. See also the `gsub` and `sub` verb
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
================================================================
|
||||
|
|
@ -1215,7 +1215,7 @@ See also the `gsub` and `ssub` verbs.
|
|||
Options:
|
||||
-f {a,b,c} Field names to convert.
|
||||
-r {regex} Regular expression for field names to convert.
|
||||
-a Convert all fields.
|
||||
-a Convert all field names.
|
||||
-h|--help Show this message.
|
||||
|
||||
================================================================
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr -o jsonl cat test/input/json-output-options.dkvp
|
||||
mlr --ojsonl cat test/input/json-output-options.dkvp
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
mlr --csv --skip-comments-with '##' cat test/input/pr-1787.csv
|
||||
|
|
@ -1 +0,0 @@
|
|||
mlr: for CSV, the comment prefix must be a single character.
|
||||
|
|
@ -27,8 +27,8 @@ if [ $# -eq 1 ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Build the bin/gocc executable (use my fork for performance):
|
||||
go install github.com/johnkerl/gocc
|
||||
# Build the bin/gocc executable:
|
||||
go install github.com/goccmack/gocc
|
||||
go mod tidy
|
||||
bingocc="$HOME/go/bin/gocc"
|
||||
if [ ! -x "$bingocc" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue