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

# writeCSV(to:)

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

## Declaration

```swift
func writeCSV(to fileURL: URL) throws
```

## Parameters

- `fileURL`: The location in the file system to which 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(toFile:)](createml/mldatatable/writecsv(tofile:).md)
