---
title: "writeCSV(toFile:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mldatatable/writecsv(tofile:)"
---

# writeCSV(toFile:)

Exports a CSV file of the data table to the given directory path.

## Declaration

```swift
func writeCSV(toFile path: String) throws
```

## Parameters

- `path`: A file system path where the data table file should be written.

## See Also

### Saving a data table

- [write(to:)](createml/mldatatable/write(to:).md)
- [write(toDirectory:)](createml/mldatatable/write(todirectory:).md)
- [writeCSV(to:)](createml/mldatatable/writecsv(to:).md)
