csv.from() function

csv.from() retrieves data from a comma separated value (CSV) data source and returns a stream of tables.

Function type signature
(?csv: string, ?file: string, ?mode: string) => stream[A] where A: Record
For more information, see Function type signatures.



CSV data.

Supports anonotated CSV or raw CSV. Use mode to specify the parsing mode.


File path of the CSV file to query.

The path can be absolute or relative. If relative, it is relative to the working directory of the fluxd process. The CSV file must exist in the same file system running the fluxd process.


is the CSV parsing mode. Default is annotations.

Available annotation modes

  • annotations: Use CSV notations to determine column data types.
  • raw: Parse all columns as strings and use the first row as the header row and all subsequent rows as data.


Query anotated CSV data from file

import "csv"

csv.from(file: "path/to/data-file.csv")

Query raw data from CSV file

import "csv"

csv.from(file: "/path/to/data-file.csv", mode: "raw")

Query an annotated CSV string

import "csv"

csvData =

csv.from(csv: csvData)

View example output

Query a raw CSV string

import "csv"

csvData =

csv.from(csv: csvData, mode: "raw")

View example output

Was this page helpful?

Thank you for your feedback!

Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.