Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Structure for SNS Bank #10

Closed
javydekoning opened this issue Mar 28, 2019 · 10 comments
Closed

CSV Structure for SNS Bank #10

javydekoning opened this issue Mar 28, 2019 · 10 comments

Comments

@javydekoning
Copy link

CSV from SNS Bank does not have headers. The format is like this:

02-03-2019,NL01SNSB0123456789,,,,,,EUR,123.45,EUR,-1.23,02-03-2019,02-03-2019,1234,BEA,12345678,'1abcde/123456','Description',4
02-03-2019,NL01SNSB0123456789,,,,,,EUR,123.45,EUR,1.23,02-03-2019,02-03-2019,1234,BEA,12345678,'1abcde/123456','Description',4

Missing Headers:
alt text

@DanielHaitink
Copy link
Owner

I know, I have the same problem with the ASN bank (same parent company I think). I fail to see why in god's name you'd create CSV files without headers for things like this. But yeah, I am thinking of a good solution to add support for headerless CSV files

@javydekoning
Copy link
Author

javydekoning commented Mar 28, 2019

What about a regex match on the first line / second column to ID the bank? Pseudo code:

if ( line[0]["col"][1].match('NL\d{2}SNSB\d{10}') ) {'SNSBANK'}

@DanielHaitink
Copy link
Owner

Hmm could be a good idea. I'll look at it tomorrow!

@DanielHaitink
Copy link
Owner

So yeah, this is gonna take some time. I have to implement my own fileStreamer to handle both headerless and headered files, while still being able to recognize the bank 😞

@DanielHaitink
Copy link
Owner

@javydekoning Hey! It should be working now! Took me some time to create everything from scratch. Can you please test it with your SNS csv files?

@javydekoning
Copy link
Author

Awesome, I'll test today

@javydekoning
Copy link
Author

javydekoning commented Apr 18, 2019

Almost correct Daniel. Problem is that there is no Payee for PIN transactions. "incasso" / "overboeking" looks correct.

Suggested fix: if column 'D' is null, take the first part of column 'R' as payee.
Alternative: if column 'Q' is NOT null, take the first part of column 'R' as payee.

Example line:
02-03-2019,NL01SNSB0123456789,,,,,,EUR,123.01,EUR,-2.41,02-03-2019,02-03-2019,7903,BEA,81349482,'8kdvqh/684577','Kruidvat 7039 >AMSTERDAM 2.03.2019 17U21 KV009 SYD0M0 MCC:5331 Contactloze betaling',4

@javydekoning
Copy link
Author

Looks like all are split by '>', so if you could split that column and trim the trailing whitespace you can use it as payee

@DanielHaitink
Copy link
Owner

Hmm looks like this is a specific SNS/ASN issue. It is a shame that their CSV files are such a mess. I'll look into a solution. I dislike adding code which is very bank-specific. I'll update you. Thanks for the email btw

@DanielHaitink
Copy link
Owner

@javydekoning I have added the extra fallback for asn and sns bank, when it comes to dealing with MCC payments 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants