mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
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:
@@ -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'] } } };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user