readCsv

The readCsv method will read a CSV file into an in-memory table.

Syntax

Parameters

ParameterTypeDescription
pathString

The file to load into a table.

pathPath

The file to load into a table. Note that compressed files are accepted: paths ending in ".tar.zip", ".tar.bz2", ".tar.gz", ".tar.7z", ".tar.zst", ".zip", ".bz2", ".gz", ".7z", ".zst", or ".tar" will automatically be decompressed before they are read.

streamInputStream

An InputStream providing access to the CSV data.

urlURL

The URL.

specsio.deephaven.csv.CsvSpecs

Specifications for how to load the CSV file.

Note

Only one format parameter can be used at a time.

Returns

A new in-memory table from a CSV file.

Examples

Note

In this guide, we read data from locations relative to the base of the Docker container. See Docker data volumes to learn more about the relation between locations in the container and the local file system.

In the following example, write_csv writes the source table to /data/file.csv, and read_csv loads the file into a Deephaven table.

Note

In the following examples, the example data found in Deephaven's example repository will be used. Follow the instructions in the README to download the data to the proper location for use with Deephaven.

In the following example, read_csv is used to load the file DeNiro CSV into a Deephaven table.

In the following example, read_csv is used to load the file DeNiro TSV into a Deephaven table. The second argument, "\t", indicates that the file contains tab-separated values.

Any character can be used as a delimiter. The pipe character (|) is common. In the following example, the second input parameter is used to read a pipe-delimited file into memory.