---
title: "parse csv · RUAL Documentation"
description: "Parse a CSV file into an array of objects."
canonical: https://docs.rual.nl/block-types/files/file_parse_csv
language: en
---

# parse csv

This block is part of the [`files`](https://docs.rual.nl/block-types/files) group and was last modified in core [`v11.5.13`](https://docs.rual.nl/core-versions/110513).

Parse a CSV file into an array of objects.

- flow `flow`

- file required `file` File to parse as CSV.

- separator `value` The separator used to split values on a row.

Default `,`

- detect separator `v11.5.13` `condition` If set to true the action will try to detect the separator based on the first few lines. If it fails to do so it will fall back to the given or default separator

Default `false`

- Has headers `condition` Indicates if the CSV has headers or not, we will use the headers to create objects using these keys if true is given.

- Custom headers `array ` Array of headers to be used in case `has_headers` is set to false.

- flow `flow`

- array `array`

- Headers `array`

- error `value`

An uploaded file becomes rows: [get](https://docs.rual.nl/block-types/files/function_get_file_from_form) takes the file from the form, [parse CSV](https://docs.rual.nl/block-types/files/file_parse_csv) turns it into an array of objects, and [filter by geo distance](https://docs.rual.nl/block-types/array/array_filter_geo_distance) keeps only the rows whose location lies within their own radius of [from city](https://docs.rual.nl/block-types/geopoint/geo_point_from_city) (here Breda). [array length](https://docs.rual.nl/block-types/array/array_length) counts what survived.

![Studio canvas example for the parse CSV block: upload, parse, filter by city.](https://docs.rual.nl/canvas-examples/file_parse_csv.png)

### Version history

Introduced in [`v10.3.11`](https://docs.rual.nl/core-versions/100311).

Last modified in [`v11.5.13`](https://docs.rual.nl/core-versions/110513).
