Flex Gateway新着情報
Governance新着情報
Monitoring API ManagerFlex Gateway新着情報
Governance新着情報
Monitoring API Manager2.x
Mule 4
3.9
1.1
2.x
1.2
7.x
readLinesWith
readLinesWith
指定されたバイナリコンテンツを複数の行に分割し、結果を配列で返します。
DataWeave バージョン 2.2.0 で導入されました。
名前 | 説明 |
---|---|
|
読み取って分割するバイナリデータ。 |
|
読み取るためのエンコードを表す文字列。 |
次の例では、改行 (\n
) で分割されるバイナリコンテンツをカンマ区切りの配列に変換します。
%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)
}
DataWeave
{
"lines": [ "Line 1", "Line 2", "Line 3", "Line 4", "Line 5" ],
"showType": "Binary"
}
JSON