OpenBI Docs Buy

Lines.FromText

A text cut into a list of lines.

Group: Binary and lines. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Lines.FromText(text as text, optional quoteStyle as any, optional includeLineSeparators as nullable logical) as list
ParameterTypeDescription
texttextThe text to cut.
quoteStyleany
optional
QuoteStyle.Csv keeps a line break inside double quotes as part of the line; QuoteStyle.None breaks at every line break.
includeLineSeparatorsnullable logical
optional
true to keep each line's line break at its end. Left out, the line breaks are dropped.

Returns

list. One text per line.

Remarks

  • A line ends at a carriage return and line feed, a line feed alone, or a carriage return alone: files from Windows, Mac and Linux all give clean lines.

Examples

Mixed line breaks

Lines.FromText("Oslo#(cr,lf)Bergen#(lf)Trondheim")
{"Oslo", "Bergen", "Trondheim"}

Keeping the line breaks

Lines.FromText("Oslo#(cr,lf)Bergen#(lf)Trondheim", QuoteStyle.None, true)
{"Oslo#(cr,lf)", "Bergen#(lf)", "Trondheim"}

Lines.ToText, Lines.FromBinary, Text.Split.

Last updated · OpenBI Studio 0.3.79