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

# fileReadLine

> インプットファイルの内容を1行ずつ読み出して列挙し、1行ずつアウトプット属性として返します。

インプットファイルの内容を1行ずつ読み出して列挙し、そのデータをアウトプット属性としてプッシュします。

## 必要なパラメータ

* **file**：読み出すファイル名。

## オプションのパラメータ

* **separator**：新しい行を決定する文字列セパレータ。デフォルト値は改行文字（`\n`）です。
* **encoding**：使用するエンコーディング。許容される値は、使用されているJVM / OS によって決まります。主なオペレーティングシステムやJVM で一般的にサポートされているエンコーディングの値には、`UTF-8`、`ASCII`、`BASE64`、`windows-1252`、および`ISO-8859-2` があります。デフォルトは`UTF-8` です。

## アウトプット属性

* **file:line**：ファイルの行番号。
* **file:data**：インプットファイルからのデータ。

## 例

この例は、1行目のデータの一部のみを書き換えます。

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