---
title: "init(contentsOfCSVFile:columns:rows:options:)"
framework: tabulardata
role: symbol
role_heading: Initializer
path: "tabulardata/dataframe/init(contentsofcsvfile:columns:rows:options:)"
---

# init(contentsOfCSVFile:columns:rows:options:)

Creates a data frame from a CSV file.

## Declaration

```swift
init<each T>(contentsOfCSVFile url: URL, columns: repeat ColumnID<each T>, rows: Range<Int>? = nil, options: CSVReadingOptions = .init()) throws
```

## Parameters

- `url`: A URL for a CSV file.
- `columns`: The column identifiers.
- `rows`: A range of indices; Set to nil to use every row in the CSV file.
- `options`: The options that tell the data frame how to read the CSV file.
