Electronic interface for the Deutsche Bank Statement CSV file

Hi,

I have setting up electronic interface for the Deutche Bank Statement.
The output from Bank is a CSV file. I have modified Erp\EI\StatementImportCSV_Template\StatementImportCSV_Template.cs program and it looks now work 90%. The problem is that the “Start Date” and the “End Date” in the header of the file are in the same field! I cannot find good idea, how to parse this field correctly.
Header example:

Transactions Kontokorrentkonto (00);;;Customer number: xxx xxxxxxxx
01/07/2019 - 01/08/2019
Old balance:;;;;123,456.78;EUR

If I separate dates to the different fields and change manually CSV file like this
01/07/2019 - 01/08/2019 -> 01/07/2019;01/08/2019

I can read the dates and everything works well.

In this case I use in the StatementImportCSV_Template.cs file for the data parsing rows:

headerRules.AddRowValue(2, 1, CSVFieldRule.FieldDesignationEnum.StartDate); 
headerRules.AddRowValue(2, 2, CSVFieldRule.FieldDesignationEnum.EndDate); 

I have trying to use Substring, but no success.
Any ideas, how to resolve this?

I realize this is old, but I’m replying for future readers…

What you are looking for is the .Split method. The following code snippet demonstrates:

    string twoDates = "01/07/2019 - 01/08/2019";

    string[] dates = twoDates.Split('-');

    foreach (string d in dates)
    {
    	Console.WriteLine("date: [{0}] ", d.Trim());
    }

This produces the following output:

date: [01/07/2019]
date: [01/08/2019]

Or if you want to refer to each date individually, use the subscripts:

date[0]
date[1]

2 Likes