From b711ee566a41f2f248cc2f5b83e3b75023688f65 Mon Sep 17 00:00:00 2001 From: Ivan Kruglov Date: Sat, 4 Jan 2025 20:17:09 +0100 Subject: [PATCH] degiroConverterV3: recover simple broken CSV records --- src/converters/degiroConverterV3.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/converters/degiroConverterV3.ts b/src/converters/degiroConverterV3.ts index a4a42f35..a0349902 100644 --- a/src/converters/degiroConverterV3.ts +++ b/src/converters/degiroConverterV3.ts @@ -22,6 +22,10 @@ export class DeGiroConverterV3 extends AbstractConverter { * @inheritdoc */ public processFileContents(input: string, successCallback: any, errorCallback: any): void { + // my exported file contained many broken records like this. It's easy to recover them. So, why not?! + // 13-04-2016,09:00,13-04-2016,ABN AMRO BANK NV,NL0011540547,"Koop 10 @ 18,3 EUR",,EUR,-183.00,EUR,,df134e52-2753-4694- + // ,,,,,,,,,,,947b-418f08d4a352 + input = input.replace(/(,[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-)\n,{11}([a-f0-9]{4}-[a-f0-9]{12})$/mg, '$1$2'); // Parse the CSV and convert to Ghostfolio import format. parse(input, {