messageReadLine

Version 24.3.9133


messageReadLine


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.

オプションのパラメータ

  • 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.

アウトプット属性

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

Replace ARCESB with CData Arc on the First Line Only

<!-- 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" />