cfsimplicity / spreadsheet-cfml

Standalone library for working with spreadsheets and CSV in CFML
MIT License
127 stars 36 forks source link

Reading CSV: Expose format setting for trailing commas #338

Closed bdw429s closed 1 year ago

bdw429s commented 1 year ago

The Commons lib has a format.withTrailingDelimiter() method which is useful for files that look like this:

Category,Meta,Category description,
FA,INTERIOR,FAMILY INTERIOR,
HA,INTERIOR,HAVANA INTERIOR,
TA,INTERIOR,HAVANA INTERIOR,
4S,INTERIOR,SPA INTERIOR,
4T,INTERIOR,SPA INTERIOR,
4A,INTERIOR,STANDARD INTERIOR,

The "with" methods are deprecated in the Java class in favor of a new builder object.
https://javadoc.io/static/org.apache.commons/commons-csv/1.10.0/index.html?org/apache/commons/csv/CSVPrinter.html

Perhaps expose a struct of configuration that can be passed that dynamically calls the builder methods to allow full access to the Java lib's features.

cfsimplicity commented 1 year ago

https://github.com/cfsimplicity/spreadsheet-cfml/blob/e0b0f38d72e489de3fb3037f80cd7f14f7723f7b/test/specs/readCsv.cfm#L24