JSONLines (.jsonl)
Background & Context

-
- Registered MIME types: application/jsonl
- JSON Lines data format.
- Consists of multiple JSON objects, one per line, representing individual data rows.
- Commonly used for storing structured JSON data.
- Text file format.
Import & Export

- Import["file.jsonl"] imports a JSONLines file as a Tabular object.
- Import["file.jsonl",elem] imports the specified elements.
- Import["file.arrow",{elem,subelem1,…}] imports subelements subelemi, useful for partial data import.
- The import format can be specified with Import["file","JSONL"] or Import["file",{"JSONL",elem,…}].
- Export["file.jsonl",expr] creates a JSONLines file from expr.
- Supported expressions expr include:
-
{v1,v2,…} a single column of data {{v11,v12,…},{v21,v22,…},…} lists of rows of data array an array such as SparseArray, QuantityArray, etc. dataset a Dataset or a Tabular object - See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements


- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Data representation elements:
-
"Data" two-dimensional array "Dataset" table data as a Dataset "Tabular" a Tabular object - Import by default uses the "Tabular" element.
- Subelements for partial data import for the "Tabular" element can take row and column specifications in the form {"Tabular",rows,cols}, where rows and cols can be any of the following:
-
n nth row or column -n counts from the end n;;m from n through m n;;m;;s from n through m with steps of s {n1,n2,…} specific rows or columns ni - Data descriptor elements:
-
"ColumnLabels" names of columns "ColumnTypes" association with data type for each column "Schema" TabularSchema object - Metadata elements:
-
"ColumnCount" number of columns stored in file "Dimensions" data dimensions "RowCount" number of rows stored in file "MetaInformation" metadata
Import Options

- General Import options:
-
"BlockSize" 1048576 how many bytes to process at a time "Schema" Automatic schema used to construct Tabular object - Possible settings for the "Schema" option include:
-
schema a complete TabularSchema specification propval a schema property and value (see reference page for TabularSchema) <|"prop1"val1,…|> an association of schema properties and values - Possible settings for the "UnexpectedFieldBehavior" option include:
-
"InferType" unexpected JSON fields are type-inferred and included in the output "Error" unexpected JSON fields cause an error "Ignore" unexpected JSON fields are ignored
Export Options

- Export options include:
-
"ExpressionFormattingFunction" Automatic - how expressions stored in a Tabular object are converted to strings
- "ExpressionFormattingFunction" can be set to the following values:
-
Automatic default conversion to string form any form supported by Format such as InputForm f arbitrary function that converts an expression to a string
Examples
open all close allBasic Examples (3)
Scope (3)
Import (3)
Show all elements available in the file:
By default, a Tabular object is returned:
Import Elements (13)
"Dataset" (2)
"Schema" (1)
Get the TabularSchema object:
"Tabular" (2)
Get the data from a file as a Tabular object:
Import Options (2)
"BlockSize" (1)
Export Options (1)
"ExpressionFormattingFunction" (1)
By default, Export uses different conversion to string depending on column types:
Use "ExpressionFormattingFunction"->InputForm to get string versions of expressions suitable for input to the Wolfram Language:
Use an arbitrary function such as SpokenString:
Use a function that specifies different rules for different expression types:
See Also
History
Introduced in 2025 (14.3)