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
- List.CSVSplit
- Matrix.CSV
- Matrix.GetValue
- Matrix.JSONRecord
- Matrix.JSONRecords
- Matrix.Release
- Matrix.SetColumnNames
- Text.ReadTextFile
Release notes
- Version 14.3
- Added header row flag for Matrix.CSVSplit to put first row into column names.
- Changed Matrix.CSVSplit to handle CSV with multi line values better.
- Version 12.4
- Fixed a problem with List.CSVSplit, Matrix.CSVSplit and QuickList.CSVSplit not parsing properly quoted multi line value.
- Version 12.2
- Optimized List.CSVSplit, QuickList.CSVSplit and Matrix.CSVSplit to better handle lonely quotes in quoted strings.
- Version 10.5
- Added Matrix.CSVSplit function.
Blog Entries
- MBS FileMaker Plugin, version 14.3pr3
- MBS FileMaker Plugin, version 14.3pr2
- CSV in FileMaker with MBS FileMaker Plugin
- MBS FileMaker Plugin, version 12.4pr1
- MBS FileMaker Plugin, version 12.2pr1
- New in MBS FileMaker Plugin 10.5
- Import CSV with Matrix functions
- Neues MBS FileMaker Plugin 10.5 - Über 6400 Funktionen in einem Plugin
- MBS FileMaker Plugin 10.5 - More than 6400 Functions In One Plugin
- MBS FileMaker Plugin, version 10.5pr4
FileMaker Magazin
This function is free to use.
Created 11st October 2020, last changed 7th June 2024