Power Query
Search…
BinaryFormat.List

BinaryFormat.List

Returns a binary format that reads a sequence of items and returns a list.
function (binaryFormat as function, optional countOrCondition as nullable any) as function

Description

Returns a binary format that reads a sequence of items and returns a list. The binaryFormat parameter specifies the binary format of each item. There are three ways to determine the number of items read:

Category

Binary Formats.Reading lists

Examples

Read bytes until the end of the data.
1
let
2
binaryData = #binary({1, 2, 3}),
3
listFormat = BinaryFormat.List(BinaryFormat.Byte)
4
in
5
listFormat(binaryData)
Copied!
{1, 2, 3}
Read two bytes.
1
let
2
binaryData = #binary({1, 2, 3}),
3
listFormat = BinaryFormat.List(BinaryFormat.Byte, 2)
4
in
5
listFormat(binaryData)
Copied!
{1, 2}
Read bytes until the byte value is greater than or equal to two.
1
let
2
binaryData = #binary({1, 2, 3}),
3
listFormat = BinaryFormat.List(BinaryFormat.Byte, (x) => x < 2)
4
in
5
listFormat(binaryData)
Copied!
{1, 2}