# Loading CSV

[Wiki](../README.md) / [Imports and exports](README.md)

## `LOAD CSV`

Read a CSV resource and emit one row per record — a row source, like `UNWIND`.

```cypher
// Without headers: `row` is a LIST of field strings.
LOAD CSV FROM 'file:///data/people.csv' AS row
RETURN row[0], row[1];

// With headers: `row` is a MAP of header name -> field string.
LOAD CSV WITH HEADERS FROM 'people.csv' AS row
CREATE (:Person {name: row.name, age: toInteger(row.age)});

// A custom delimiter:
LOAD CSV WITH HEADERS FROM 'people.tsv' AS row FIELDTERMINATOR '\t'
RETURN row.name;
```

- **Sources**: a local filesystem path, a `file://` URL, or a plain `http://` URL.
  `https://` is **not** supported — download the
  file and load it by path.
- **Every field is a STRING.** Convert with `toInteger()` / `toFloat()` /
  `date()` etc..
- **Quoting** is RFC 4180: a field may be `"quoted"`; inside quotes the delimiter,
  `,` and newlines are literal and a doubled `""` is one `"`. `LF`, `CR` and
  `CRLF` line endings are all accepted.
- With headers, a record with fewer fields than headers maps the missing ones to
  `null`; an unterminated quoted field is an error.
- Ordinary LOAD CSV materialises its result. A direct
  `LOAD CSV ... CALL { ... } IN TRANSACTIONS OF 1000 ROWS` streams input
  and commits each batch independently. See
  [Batched subqueries and logical interchange](interchange.md#batched-subqueries-and-logical-interchange).

## Related articles

[Backup, restore and transfer](../operations/backups.md) · [Transactions and concurrency](../operations/transactions.md) · [Server configuration](../operations/configuration.md)
