---
schema_version: "1"
id: 727e0700af1a59c2168ad56afdef061cc700f7bb3e888c767879f41762c36be3
title: readLinesWith
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-binaries-functions-readlineswith.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-binaries-functions-readlineswith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1e2e921edd1a533565d7e339070bdc3ca9b97e2a4cd2974e3445e4ce091659d7
description: MuleSoft Documentation Site
release: "2.8"
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"
}
```