---
schema_version: "1"
id: e488de0d881c5753c7633174a8c71af2cc52de48dbc11a40f2a933f354627d39
title: Use a Reader Property through a Connector Operation
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.6/dataweave-cookbook-reader-prop-connector.md
canonical_url: https://docs.mulesoft.com/dataweave/2.6/dataweave-cookbook-reader-prop-connector
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1287abe92dc21708044f3f91ad24e426e56f5cdcc51029ad6b1702c74fad9079
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
---
product: DataWeave
version: 2.6
keywords: studio, anypoint, transform, transformer, format, dataweave, data weave, output structure, mime type, mime
---

# Use a Reader Property through a Connector Operation

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Connector operations that read input data provide an `outpuMimeType` field that you can use to
identify the _input_ MIME type. This field also accepts one or more reader properties, which is
useful for helping DataWeave read the input correctly.

By default, the DataWeave reader treats a comma (`,`) as a separator. However, assume that a CSV
input is separated by the pipe (`|`) but that the content also contains commas. You can set a CSV
reader property to recognize the pipe as the separator.

Pipe-separated CSV Input

```csv
id | name | role
1234 | Shokida,Mr. | dev
2345 | Achaval,Mr. | arch
3456 | Felisatti,Ms. | mngr
4567 | Chibana,Mr. | dev
```

The following example uses the Read operation in the File connector to read the pipe-separated (`|`)
CSV input, and it uses a DataWeave script in the Transform Message component to output a row of the
input in comma-separated format.

Mule Flow:

```xml
<flow name="ex-use-csv-reader-props" >
	<scheduler doc:name="Scheduler" >
		<scheduling-strategy >
			<fixed-frequency frequency="90" timeUnit="SECONDS"/>
		</scheduling-strategy>
	</scheduler>
	<file:read doc:name="Read" config-ref="File_Config" path="staff.csv"
	           outputMimeType='application/csv; separator=|; header=true'/>
	<ee:transform doc:name="Transform Message" >
		<ee:message>
			<ee:set-payload><![CDATA[%dw 2.0
output application/csv header = false
---
payload[1]]]></ee:set-payload>
		</ee:message>
	</ee:transform>
	<logger level="INFO" doc:name="Logger" message="#[payload]"/>
</flow>
```

The Scheduler component (`<scheduler/>`) in the example generates a Mule event each time it triggers
the flow.

The Read operation (`<file:read/>`) uses
`outputMimeType='application/csv; separator=|; header=true'` to identify the input MIME type
(`application/csv`), the CSV separator (`|`), and the header setting (`true`).

The script in the Transform Message component (`<ee:transform-message/>`) returns the second row
from the input CSV (`2345 , Achaval\,Mr. , arch`). The script uses `payload[1]` to select that row
because DataWeave treats each row in the CSV as an index of an array. The output is comma-separated
because the default CSV separator is a comma. The script omits the CSV header from the output by
using the `output` directive (`output application/csv header = false`).

The Logger component (`<logger/>`), which is set to `payload`, writes the comma-separated output as
INFO in its `LoggerMessageProcessor` message: `2345 , Achaval\,Mr. , arch`. To avoid treating the
comma before "Mr." as a separator, the CSV output escapes the comma with a backslash
(`Achaval\,Mr.`).

The following examples pass reader properties through the `outputMimeType` field:

- [CSV example](https://docs.mulesoft.com/dataweave/2.6/dataweave-formats-csv#example2) that uses `streaming=true; header=true`

- [JSON example](https://docs.mulesoft.com/dataweave/2.6/dataweave-formats-json#example3) that uses `streaming=true`

## See Also

- [DataWeave Formats](https://docs.mulesoft.com/dataweave/2.6/dataweave-formats)

- [Core Components](https://docs.mulesoft.com/mule-runtime/latest/about-components)

- [DataWeave Cookbook](https://docs.mulesoft.com/dataweave/2.6/dataweave-cookbook)
