Closed jhorbulyk closed 3 years ago
Read
and Write
actions rework.
1.1. Check whether https://www.papaparse.com/ lib satisfies the requirementsHi @jhorbulyk, during development new Read action there were several questions:
By default, after parsing all value is strings, we can use dynamicTyping to try convert them to appropriate data type, but functionality of this method is not really big, for example numbers with space "1 234.5" or comma "1,234" will not be set to number type, only with dot - "1.234" or simple "1234", what we should do:
dynamicTyping
to let papaparse decide which kind of data to usedynamicTyping
to Config Fields If header
set to false
this library create array of string instead of objects, something like this, ['asd', 'fgh', 'jkl']
{
"field1": "asd",
"field2": "fgh",
"field3": "jkl"
}
{
"data": [
"asd",
"fgh",
"jkl"
]
}
header
as always true
dynamicTyping
can be added as another CSV parse mechanism in the input metadata. If people need more complex parsing than what is built-in to papaparse, they can write there own string parsing expression with JSONata.column0
, column1
, column2
, etc. (Either 0-based or 1-based column counting)
Config Fields
Input Metadata
header
option in papaparseOutput Metadata
results
which is an array where each item in the array is an object representing a row in the CSV file.Implementation Notes