---
title: CSV
description: See available data formats
documentId: ipaas-data-formats-csv
locale: en-US
---

The **CSV** (Comma-Separated Values) format is widely used to store and exchange tabular data in a simple way, compatible with spreadsheets and legacy systems. In the context of integrations, CSV allows you to transform files into JSON structures and vice versa, making it easier to manipulate and exchange information between different applications.

<Callout type="tip" title="ADVANCED TIPS">

**Delimiter:**  
The default is a comma, but you can use semicolon, tab, or another character depending on your data source.

**useMaps:**  
Enable this so each row is converted into an object (map), making it easier to access fields by header name.

**Limitations:**  
Be aware of fields containing line breaks, quotes, or delimiters within values. Make sure your CSV is well formatted to avoid parsing errors.

**Useful links:**  
[CSV Apache Camel](https://camel.apache.org/components/4.14.x/dataformats/csv-dataformat.html)

**Common error:**  
Missing or inconsistent headers can cause failures when converting to JSON. Always validate your input file.
</Callout>

## Example

The example below shows how a flow can receive a CSV file, process it, and return the data converted to JSON.

```yaml

  uri: "rest:POST:/csv-to-json"
  steps:
  - unmarshal:
    csv:
      delimiter: ","
      useMaps: true
  - marshal:
    json: {}
```

<Steps>
<Step>
The flow is triggered by receiving a POST request with CSV data in the body.

 Input: 

 ```csv
 firstName;lastName
 joão;souza
 maria;santos
 ``` 
</Step>
<Step>
The Unmarshal EIP converts the data from CSV format to Camel's internal structure. 
- It uses a comma as the field separator (`delimiter: ","`)
- and creates an array of objects/maps (`useMaps: true`).
</Step>
<Step>
The Marshal EIP converts the internal structure to JSON (external format), which is returned as the API response.

 Output (JSON):

 ```json
 [
    {
        "firstName": "joão",
        "lastName": "souza"
    },
    {
        "firstName": "maria",
        "lastName": "santos"
    }
 ]
 ```
</Step>
</Steps>
