docs/src/troubleshooting-csv-and-json-input.md
When Miller reports a parse error, it is often useful to first identify whether the issue is in the file format, in the chosen input flag, or in the shell quoting around the Miller expression.
--icsv for
CSV input and --ijson for JSON input, even if you are writing a different format such as
--ojson or --ocsv.--icsv. If the file simply splits on commas with no CSV escaping, try
--csvlite or --icsvlite instead. See also File Formats.--csv-trim-leading-space can help
when fields look like "foo", "bar", where the second field has a leading space before the quote.--lazy-quotes can help Miller accept
input that is not fully RFC-4180 compliant.--implicit-csv-header (or -N when you also want headerless output) so
fields are addressed as $1, $2, and so on. See also
CSV, with and without headers.3, or an array of scalars such as [1,2,3], is valid JSON
but not a Miller record. See also this page.--flatsep to choose a separator, or --no-auto-flatten when you want to
preserve nested values in non-JSON output. See also
Flatten/unflatten: converting between JSON and tabular formats.--ijsonl for newline-delimited JSON objects (JSON Lines). Use --ijson for ordinary JSON
arrays or single objects.$field names before Miller sees them: mlr --icsv put '$total = $price * $quantity' data.csv.-f script.mlr, or use your shell's quoting rules carefully. See also
Miller on Windows for some complexity issues on Windows.mlr --icsv head -n 3 file.csv or mlr --ijson head -n 3 file.json, then add verbs one at a time. See also
Questions about then-chaining.