> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# messageReadLine

> Reads and enumerates over the contents of a message item on a line-by-line basis, returning one line at a time from the message.

Reads and enumerates over the contents of a message item on a line-by-line basis and returns one line at a time from the message.

## Optional Parameters

* **separator**: The character separator that determines each new line. The default value is the newline character (`\n`).
* **encoding**: The encoding to use. The allowed values are determined by the JVM/OS being used. Values for encodings that are generally supported by most operating systems and JVMs include `UTF-8`, `ASCII`, `windows-1252`, and `ISO-8859-2`. The default is `UTF-8`.

## Output Attributes

* **line**: The line number of the data being pushed out from the message.
* **data**: The line data from the message.

## Example

### Replace ARCESB with CData Arc on the First Line Only

```xml theme={null}
<!-- Initializing the item to hold the message data minus the first line -->
<arc:set attr="restof.data" value="" />
<!-- Calling the messageReadLine operation and setting the output item -->
<arc:call op="messageReadLine" out="result" >
  <!-- Once the operation gets to the first line in the message data, perform a replace -->
  <arc:if exp="[result.line] == 1">
    <arc:set attr="first.line" value="[result.data | replace('ArcESB','CData Arc')]" />
    <arc:else>
      <!-- Setting the data for the output message to be the concatenation of the modified first line and the rest of the message data -->
      <arc:set attr="output.data" value="[first.line][restof.data]\n[result.data]" />
    </arc:else>
  </arc:if> 
</arc:call>
<arc:set attr="output.filepath" value="[FilePath]" />
<arc:push item="output" />
```
