From 82da06185ccd0c52bdcc70a55a0436fbbe44e0c2 Mon Sep 17 00:00:00 2001 From: David Papp Date: Wed, 1 Feb 2023 15:07:10 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20CSV=20importer=20improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/integrations/csv-import/csvImportIntegration.ts | 2 ++ src/types/account.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/integrations/csv-import/csvImportIntegration.ts b/src/integrations/csv-import/csvImportIntegration.ts index 7ae9f036..1ba878bc 100644 --- a/src/integrations/csv-import/csvImportIntegration.ts +++ b/src/integrations/csv-import/csvImportIntegration.ts @@ -41,6 +41,8 @@ export class CSVImportIntegration { return files.map(match => { try { const rows = parse(readFileSync(match), { + encoding: 'utf8', + delimiter: Buffer.from(CSVAccountConfig.delimiter, 'utf8'), columns: true, skip_empty_lines: true }) diff --git a/src/types/account.ts b/src/types/account.ts index bf170636..55605e5c 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -41,6 +41,7 @@ export interface CSVAccountConfig extends BaseAccountConfig { transformer: { [inputColumn: string]: keyof Transaction } dateFormat: string negateValues?: boolean + delimiter?: string } export type AccountConfig = PlaidAccountConfig | CSVAccountConfig