This function counts the times a char is found in a string
Name | Type | Description | |
---|---|---|---|
str |
String
|
This is the text to be searched in |
|
c |
Char
|
This is the single text character to search |
Number
Returns a number of found matches
This function determines the line endings used in a string
Name | Type | Description | |
---|---|---|---|
str |
String
|
This is the text to inspect |
Number
Returns the used line ending type
This function splits a string containing multiple CSV/TSV tables and returns an object of string or if optionaly into a data format
Name | Type | Description | |
---|---|---|---|
text |
String
|
This is the text (either TSV or CSV) containing the tables |
|
convert |
Boolean
|
If this boolean is set to true table is directly converted else it is kept as a string |
|
options |
Object
|
This object can be used to override defaults and is only used if conversion is enabled |
Object
Returns an object with tables referenced by index and if provided also by sheet and table name
This function determines if a string most likely contains multiple tables (very simple check)
Name | Type | Description | |
---|---|---|---|
str |
String
|
This is the text to inspect |
Boolean
Returns if the provided text contains multiple tables
This function parses a CSV string into an array structur Given a second paramter options of type object, default options can be overriden
fSep
defaults to ';' or ',' (depending on what character is found more often)rSep
defaults to '\n', '\r' or '\r\n' (depending on auto detection mechanism)quot
defaults to '"'head
defaults to false and allows ignoring the first rowtrim
defaults to falseName | Type | Description | |
---|---|---|---|
csv |
String
|
This is the text to consider as CSV |
|
options |
Object
|
This object can be used to override defaults |
Array
Returns an array of rows with nested arrays of field data
This function transposes rows to columns as long as the length of the inital row is the same
Name | Type | Description | |
---|---|---|---|
csv |
String
|
This is the text to consider as CSV |
|
options |
Object
|
This object can be used to override defaults |
Array
Returns an array of rows transposed to columns
This function uses csvToArray (see function description), but converts the basic array into an object with keys based on the header. Because that is the case the removeHead option cannot be overriden and a header should be present in the CSV for text to work properly.
Name | Type | Description | |
---|---|---|---|
csv |
String
|
This is the text to consider as CSV |
|
options |
Object
|
This object can be used to override defaults |
Array
Returns an array of rows with nested objects containing named fields
Parse a CSV file into an object grouped by the specified key, containing each an array of rows of nested objects with named cells (key and value).
If a specific object key only has a single member, the object is directly listed without being nested in an array. The behavior of this function
can be modified by specifying the value of options.objectByKeyMode
:
auto
(default) - this setting parses each nested key into a direct object, but converts it into a list if multiple elements by the key are foundlist
- this setting always forces a nested array listing. Hence, even single entries by the specified key will result in a nested arrayreduce
- this function never creates a nested list and multiple entries by a specified key overwrite each other and the last occurrence prevailsName | Type | Description | |
---|---|---|---|
csv |
String
|
This is the text to consider as CSV |
|
key |
String
Number
|
Either the key as a name or the index as a number (0 based) |
|
options |
Object
|
This object can be used to override defaults |
Object
Returns an object with named keys with nested objects containing named fields
This function parses a CSV string into an array structur while reducing the return to a shallow list with a single column of data
Name | Type | Description | |
---|---|---|---|
csv |
String
|
This is the text to consider as CSV |
|
key |
String
Number
|
Either the key as a name or the index as a number (0 based) |
|
options |
Object
|
This object can be used to override defaults |
Array
Returns an array data from the requested column
This is an alias to the TSV version of the csvToArray method. The only difference being that the field separator (fSep) is set to tab (\t). Please look at the documentation for csvToArray
Void
This is an alias to the TSV version of the csvToObject method. The only difference being that the field separator (fSep) is set to tab (\t). Please look at the documentation for csvToObject
Void
This is an alias to the TSV version of the csvToArrayByKey method. The only difference being that the field separator (fSep) is set to tab (\t). Please look at the documentation for csvToArrayByKey
Void
This is an alias to the TSV version of the csvToObjectByKey method. The only difference being that the field separator (fSep) is set to tab (\t). Please look at the documentation for csvToObjectByKey
Void
Name | Type | Description | |
---|---|---|---|
version |
String
|
Version of the extension |
|
csvToArray |
Function
|
Convert a CSV string into an array rows with nested cells |
|
csvToArrayByKey |
Function
|
Convert a CSV string into an array of cells |
|
csvToObject |
Function
|
Convert a CSV string into an array of nested objects (cells as key, value) |
|
csvToObjectByKey |
Function
|
Convert a CSV string into an object grouped by the specified key with array of nested objects (cells as key, value) |
|
tsvToArray |
Function
|
Convert a TSV string into an array rows with nested cells |
|
tsvToArrayByKey |
Function
|
Convert a TSV string into an array of cells |
|
tsvToObject |
Function
|
Convert a TSV string into an array of nested objects (cells as key, value) |
|
tsvToObjectByKey |
Function
|
Convert a TSV string into an object grouped by the specified key with array of nested objects (cells as key, value) |
|
rowsToColumns |
Function
|
Returns a transposed array shifting row into columns (works on values from csvToArray) |
|
getTables |
Function
|
Returns all found tables in an object lookup with index keys. If provided sheet and table names are additionaly used in the lookup. |
|
includesTables |
Function
|
Returns a boolean indicating if a CSV/TSV string most likely contains multiple tables (simple check) |
|
getLineBreakChar |
Function
|
Returns the line break character used in a multiline string |
|
countChar |
Function
|
Returns the number of occurances of a given char in a string |
Void