Senipah / VBA-Better-Array

An array class for VBA providing features found in more modern languages
MIT License
112 stars 18 forks source link

Bug in Method "FromCSV" #1

Closed Micha19x closed 4 years ago

Micha19x commented 4 years ago

Hallo Senipah !

Thanks for your excellent development work on the VBA class "BetterArray".

In the method "FromCSV" I have detected an error.

If the CSV file has no final CRLF this last CSV line is not included in the array.

For example, the following sample CSV file fails:

-------------- BEGIN CSV FILE ----------------- HeaderCol1,HeaderCol2,HeaderCol3,HeaderCol4,HeaderCol15[CRLF] Row1Col1,Row1Col2,Row1Col3,Row1Col4,Row1Col5[CRLF] Row2Col1,Row2Col2,Row2Col3,Row2Col4,Row2Col5 -------------- BEGIN CSV FILE -----------------

NOTE: [CRLF] above should represent the character CRLF

See also screenshots below

CSV-Sample

TestCode

LocalWindowVBA

Senipah commented 4 years ago

Thanks for the report @Micha19x ! Very much appreciated!

This should now work in latest (v1.5.1). If you spot any other deficiencies or you still have issues with this please let me know and I will reopen.

This method is roadmapped to be assessed for refactoring to see if performance can be improved for large files in the near future.

Thanks for using BetterArray. Please let me know if there are any additions/ improvements you would like to see.