# CSV / TSV

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

Kotlin DataFrame supports reading from and writing to CSV and TSV files.

API reference: [readCsv](https://kotlin.github.io/dataframe/api-docs/dataframe-csv/org.jetbrains.kotlinx.dataframe.io/read-csv.html), [readTsv](https://kotlin.github.io/dataframe/api-docs/dataframe-csv/org.jetbrains.kotlinx.dataframe.io/read-tsv.html), [readDelim](https://kotlin.github.io/dataframe/api-docs/dataframe-csv/org.jetbrains.kotlinx.dataframe.io/read-delim.html), [writeCsv](https://kotlin.github.io/dataframe/api-docs/dataframe-csv/org.jetbrains.kotlinx.dataframe.io/write-csv.html), [dataframe-csv module](https://kotlin.github.io/dataframe/api-docs/dataframe-csv/index.html)

Requires the [dataframe-csv module](modules.html#dataframe-csv), which is included by default in the general [dataframe](modules.html#dataframe-general) artifact and in [%use dataframe](setupkotlinnotebook.html#integrate-kotlin-dataframe) for Kotlin Notebook.

## Read

You can read a [DataFrame](dataframe.html) from a CSV or TSV file (via a file path or URL) using the [readCsv()](read.html#read-from-csv) or `readTsv()` methods:

```KOTLIN
val df = DataFrame.readCsv("example.csv")
```

```KOTLIN
val df = DataFrame.readCsv("https://kotlin.github.io/dataframe/resources/example.csv")
```

## Write

You can write a [DataFrame](dataframe.html) to a CSV file using the [writeCsv()](write.html#writing-to-csv) method:

```KOTLIN
df.writeCsv("example.csv")
```

## Deephaven CSV

The [dataframe-csv](modules.html#dataframe-csv) module uses the high-performance [Deephaven CSV library](https://github.com/deephaven/deephaven-csv) under the hood for fast and efficient CSV reading and writing.

If you're working with large CSV files, you can adjust the parser manually by [configuring Deephaven-specific parameters](https://kotlin.github.io/dataframe/read.html#unlocking-deephaven-csv-features) to get the best performance for your use case.

