---
schema_version: "1"
id: 4b4a7c50dab65525d43f4224d8f71bcd3c3176ad62d0f04932e32e753867400f
title: readLinesWith
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-binaries-functions-readlineswith.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-binaries-functions-readlineswith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d6df14b8c70c2ba91d2267597fd2ff17c7bac11be4b566bf601e36d94baeacb7
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# readLinesWith

## [](#readlineswith1)readLinesWith(content: Binary, charset: String): Array<String>

指定されたバイナリコンテンツを複数の行に分割し、結果を配列で返します。

_DataWeave バージョン 2.2.0 で導入されました。_​

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>content</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">読み取って分割するバイナリデータ。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>charset</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">読み取るためのエンコードを表す文字列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、改行 (​`\n`​) で分割されるバイナリコンテンツをカンマ区切りの配列に変換します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import * from dw::core::Binaries
var content = read("Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n", "application/octet-stream")
output application/json
---
{
   lines : (content readLinesWith "UTF-8"),
   showType: typeOf(content)
}
```

#### [](#出力)出力

```JSON
{
   "lines": [ "Line 1", "Line 2", "Line 3", "Line 4", "Line 5" ],
   "showType": "Binary"
}
```