JSONL output does not properly handle keys with quotes (#1425)

* mlr --l2j, --j2l

* make dev for previous commit

* fix #1424

* unit-test cases

* iterate
This commit is contained in:
John Kerl 2023-11-11 18:58:49 -05:00 committed by GitHub
parent f2a9ae5ca4
commit 5b6a1d4713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 90 additions and 54 deletions

View file

@ -1680,6 +1680,21 @@ var FormatConversionKeystrokeSaverFlagSection = FlagSection{
*pargi += 1
},
},
{
name: "--j2l",
help: "Use JSON for input, JSONL for output.",
// For format-conversion keystroke-savers, a matrix is plenty -- we don't
// need to print a tedious 60-line list.
suppressFlagEnumeration: true,
parser: func(args []string, argc int, pargi *int, options *TOptions) {
options.ReaderOptions.InputFileFormat = "json"
options.WriterOptions.OutputFileFormat = "json"
options.WriterOptions.WrapJSONOutputInOuterList = false
options.WriterOptions.JSONOutputMultiline = false
*pargi += 1
},
},
{
name: "--j2t",
help: "Use JSON for input, TSV for output.",
@ -1803,6 +1818,18 @@ var FormatConversionKeystrokeSaverFlagSection = FlagSection{
*pargi += 1
},
},
{
name: "--l2j",
help: "Use JSONL for input, JSON for output.",
// For format-conversion keystroke-savers, a matrix is plenty -- we don't
// need to print a tedious 60-line list.
suppressFlagEnumeration: true,
parser: func(args []string, argc int, pargi *int, options *TOptions) {
options.ReaderOptions.InputFileFormat = "json"
options.WriterOptions.OutputFileFormat = "json"
*pargi += 1
},
},
{
name: "--l2n",
help: "Use JSON Lines for input, NIDX for output.",