TypstDocumentation

csv

Reads structured data from a CSV file.

The CSV file will be read and parsed into a 2-dimensional array of strings: Each row in the CSV file will be represented as an array of strings, and all rows will be collected into a single array. Header rows will not be stripped.

Example

#let results = csv("data.csv")

#table(
  columns: 2,
  [*Condition*], [*Result*],
  ..results.flatten(),
)
Preview

Parameters
Question mark

path
str
RequiredPositional
Question mark

Path to a CSV file.

delimiter

The delimiter that separates columns in the CSV file. Must be a single ASCII character.

Default: ","

Definitions
Question mark

decode

Reads structured data from a CSV string/bytes.

csv.decode() -> array

data
str or bytes
RequiredPositional
Question mark

CSV data.

delimiter

The delimiter that separates columns in the CSV file. Must be a single ASCII character.

Default: ","