All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
FieldModifiers.modify(Function<String, String>)
to simply modify fields via functional interface
SimpleFieldModifier
interfaceFieldModifiers.lower
andFieldModifiers.upper
methods
3.6.0 - 2025-03-04
- Configuration of maximum fields, maximum field size, and maximum record size via record handler
- Fluent configuration for
CsvRecordHandler
,NamedCsvRecordHandler
, andStringArrayHandler
maxBufferSize(int)
inCsvReaderBuilder
andIndexedCsvReaderBuilder
to alter the maximum buffer size of the parser
- Use ReentrantLock in IndexedCsvReader instead of synchronized to prevent pinning of virtual threads
- More precise error messages when exceeding the maximum field or record size
- More precise error when parsing error occurs within
IndexedCsvReader
- Apply length constraints (maximum field size and maximum record size) after applying field modifiers
- Setting the maximum field size (and maximum buffer size) via system property
fastcsv.max.field.size
- Setting the maximum field count per record via system property
fastcsv.max.field.count
- Constructor initialization of
CsvRecordHandler
,NamedCsvRecordHandler
, andStringArrayHandler
3.5.0 - 2025-02-22
- Support InputStream as an input source for CsvReader including BOM detection #130
- Support OutputStream as an output target for CsvWriter
3.4.0 - 2024-11-04
- Add
skipLines(int)
andskipLines(Predicate<String>, int)
toCsvReader
to skip lines before the actual CSV data starts
3.3.1 - 2024-09-23
- Fixed a bug in CsvReader where lines were mistakenly treated as empty and skipped when skipEmptyLines was set (default). These affected lines made up solely of field separators, solely empty quoted fields, or fields rendered empty after applying optional field modifiers.
3.3.0 - 2024-09-19
- Implement
Flushable
interface forCsvWriter
to allow flushing the underlying writer - Implement
autoFlush
option forCsvWriter
to automatically flush the writer after writing a record - Implement
toConsole
method forCsvWriter
to write records to the console
3.2.0 - 2024-06-15
- Add
writeRecord()
toCsvWriter
to allow writing records field by field - Allow overwriting the limits of 16K fields per record and 16M characters per field (#104); Thanks to @Obolrom!
3.1.0 - 2024-03-09
- Add acceptCharsAfterQuotes() to CsvReaderBuilder and IndexedReaderBuilder to allow even stricter parsing
- Improved reader performance
3.0.0 - 2024-01-10
IndexedCsvReader
for random access to CSV filesFieldModifier
for modifying fields while reading CSV files- Allow custom quote strategies for CsvWriter
CsvCallbackHandler
for more flexible usage of CsvReader- Support for optional BOM header when reading CSV files
- Method
NamedCsvRecord.findField
for optional field access - Allow READ comment strategy for CSV data with a header
- Metadata for OSGi capability
- Updated from Java 8 to Java 11
- Updated naming (rows/lines -> records, columns -> fields, differentiate between lines and records)
NamedCsvReader
replaced byCsvReader.builder().ofNamedCsvRecord()
build
methods inCsvReaderBuilder
with callback handlers andofCsvRecord
/ofNamedCsvRecord
as convenience methods- Rename
errorOnDifferentFieldCount()
toignoreDifferentFieldCount()
QuoteStrategy
is now an interface – defaults are provided byQuoteStrategies
- Throw
CsvParseException
instead ofIOException
when maximum field size is exceeded NamedCsvRecord
extendsCsvRecord
and provides more access methods- Raised the maximum field size to 16 MiB to match SUPER data type capabilities of Amazon Redshift
- Limit the maximum field count per record to 16,384 to prevent OutOfMemoryErrors
- Limit the maximum record size to 64 MiB to prevent OutOfMemoryErrors
- Several performance improvements
- Improved documentation and error messages
- Removed
isEmpty()
inCsvRecord
as it was formerly only used for skipping empty records
- Do not throw an exception when reading comments while enabling different field count checking
2.2.2 - 2023-05-13
- New quote strategy that adds quotes only for non-empty fields #80
2.2.1 - 2022-11-09
- Fixed a problem when refilling the input buffer while parsing nonconforming data (quote character within unquoted field) #67
2.2.0 - 2022-06-20
- Improved CsvReader performance for String input #63
- Added configurable buffer size for CsvWriter #63
- Erroneous random access file feature #59
2.1.0 - 2021-10-17
- Builder methods for standard encoding (UTF-8)
- Comment support for writer
- toString() method to CsvWriter and CsvWriterBuilder
- Support for random access file operations
- Improved error message when buffer exceeds (because of invalid CSV data) #52
- Defined 'de.siegmar.fastcsv' as the Automatic-Module-Name (JPMS module name)
2.0.0 - 2021-01-01
- Completely re-engineered the API for better usability
- Improved performance
- Make use of Java 8 features (like Streams and Optionals)
- Replaced TestNG with JUnit 5
- Changed license from Apache 2.0 to MIT
- CsvContainer concept – use
Stream.collect()
as a replacement java.io.File
API – usejava.nio.file.Path
instead
1.0.4 - 2020-11-29
- Fix null returning CsvContainer when only a header is present #38
- Remove unnecessary temporary objects in CsvAppender #8
1.0.3 - 2018-10-06
- Fix dropping empty quoted fields #19
1.0.2 - 2018-02-03
- Fix reading of non RFC 4180 compliant CSV data #2
- Refactored csv parser code
1.0.1 - 2016-03-20
- Replaced Maven with Gradle (and cleaned up / reformatted code for checkstyle update)
- Initial release