---
schema_version: "1"
id: 91f3e7047348c44ed8625456a0cb94f6c46e309ed7baff1cb152504ef89fd98e
title: writeLinesWith
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-binaries-functions-writelineswith.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-binaries-functions-writelineswith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c3668f4ebd911e6a6c71fe67a6aa0b983991ea1a6c435b4d4eff7216f5834303
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# writeLinesWith

## [](#writelineswith1)writeLinesWith(Array<String>, String): Binary

指定された行を書き込んで、バイナリコンテンツを返します。

_DataWeave 2.2.0 で導入されました。Mule 4.2 以降でサポートされます。_​

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

<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`​) を各反復の後に挿入します。具体的には、​`map`​ を使用して ​`to(1, 10)`​ の結果 (​`[1,2,3,4,5]`​) を反復処理した後、指定されたコンテンツ ("Line $") を書き込みます。このコンテンツには、配列内の各番号の代わりに名前のない変数 ​`$`​ が含まれます。

`writeLinesWith "UTF-8"`​ のない式 ​`{ lines: to(1, 10) map "Line $" }`​ では、オブジェクトの値として単に行番号の配列 (​`{ "lines": [ "line 1", "line 2", "line 3", "line 4", "line 5" ] }`​) が返されます。

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

```DataWeave
%dw 2.0
import * from dw::core::Binaries
output application/json
---
{ lines: to(1, 10) map "Line $" writeLinesWith  "UTF-8" }
```

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

```JSON
{
  "lines": "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n"
}
```