Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Matrix.CSVSplit

Splits CSV text.

Component Version macOS Windows Linux Server iOS SDK
Matrix 10.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Matrix.CSVSplit"; Text { ; Delimiter; Flags } )   More

Parameters

Parameter Description Example Flags
Text The CSV text. "Hello;World"
Delimiter The delimiter to use.
If empty, we auto detect it.
";" Optional
Flags Available in MBS FileMaker Plugin 14.3 or newer.
Pass 1 to move first row into column names.
1 Optional

Result

Returns matrix or error.

Description

Splits CSV text.
Plugin automatically detects if tab, comma or semicolon is used.
Returns new matrix with all values.
Width is defined by first row.

Please call Matrix.Release later to free the matrix object.

Examples

Test it by sparsing and putting back to CSV:

Let ([

matrix = MBS( "Matrix.CSVSplit"; "FirstName;LastName;City¶Joe;Miller;Las Vegas¶Bob;\"Johnson-Meyer\";\"Köln\"");
text = MBS("Matrix.CSV"; matrix);
r = MBS("Matrix.Release"; matrix)

]; text )

Quick test with CSV file:

Let([
      text = MBS ( "Text.ReadTextFile"; "/Users/cs/Documents/test.csv"; "utf-8");
      matrix = MBS( "Matrix.CSVSplit"; text; ","; 1 );
      json = MBS("Matrix.JSONRecords"; matrix; "");
      r = MBS("Matrix.Release"; matrix)
]; json)

See also

Release notes

Blog Entries

This function is free to use.

Created 11st October 2020, last changed 7th June 2024


Matrix.CSV - Matrix.Clear