feat(Extract from File Node): Add relax_quote option (#13607)

Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
This commit is contained in:
Florian Kinder
2025-03-21 23:44:51 +09:00
committed by GitHub
parent 8215e0b59f
commit 830d2c5df5
3 changed files with 17 additions and 1 deletions

View File

@@ -18,7 +18,9 @@ export const description: INodeProperties[] = fromFile.description
newProperty.options = (newProperty.options as INodeProperties[]).map((option) => { newProperty.options = (newProperty.options as INodeProperties[]).map((option) => {
let newOption = option; let newOption = option;
if ( if (
['delimiter', 'encoding', 'fromLine', 'maxRowCount', 'enableBOM'].includes(option.name) ['delimiter', 'encoding', 'fromLine', 'maxRowCount', 'enableBOM', 'relaxQuotes'].includes(
option.name,
)
) { ) {
newOption = { ...option, displayOptions: { show: { '/operation': ['csv'] } } }; newOption = { ...option, displayOptions: { show: { '/operation': ['csv'] } } };
} }

View File

@@ -210,6 +210,19 @@ export const fromFileOptions: INodeProperties = {
description: description:
'Whether to detect and exclude the byte-order-mark from the CSV Input if present', 'Whether to detect and exclude the byte-order-mark from the CSV Input if present',
}, },
{
displayName: 'Preserve Quotes',
name: 'relaxQuotes',
type: 'boolean',
displayOptions: {
show: {
'/fileFormat': ['csv'],
},
},
default: false,
description:
"Whether to handle unclosed quotes in CSV fields as part of the field's content instead of throwing a parsing error",
},
{ {
displayName: 'Header Row', displayName: 'Header Row',
name: 'headerRow', name: 'headerRow',

View File

@@ -95,6 +95,7 @@ export async function execute(
bom: options.enableBOM as boolean, bom: options.enableBOM as boolean,
to: maxRowCount > -1 ? maxRowCount : undefined, to: maxRowCount > -1 ? maxRowCount : undefined,
columns: options.headerRow !== false, columns: options.headerRow !== false,
relax_quotes: options.relaxQuotes as boolean,
onRecord: (record) => { onRecord: (record) => {
if (!options.includeEmptyCells) { if (!options.includeEmptyCells) {
record = Object.fromEntries( record = Object.fromEntries(