
A powerful and flexible library for handling comma-separated values (CSV) files in Delphi and C++Builder.
Read and modify existing CSV files:
with TCsv.Create do try LoadAnsiFile('C:\data.csv'); ShowMessage(ToString); if (LineCount > 1) and (FieldCount[1] > 2) then Fields[1, 2] := 'New value'; ShowMessage(ToString); finally Free; end;
Create new CSV files:
with TCsv.Create do try LineCount := 10; for I := 0 to LineCount - 1 do begin FieldCount[I] := 3; for J := 0 to FieldCount[I] - 1 do Fields[I, J] := 'Field ' + IntToStr(I) + ' ' + IntToStr(J); end; ToUtf8File('C:\new.csv'); finally Free; end;
Use the high-performance TCsvWriter to create CSV files efficiently, without the in-memory overhead of the TCsv class:
with TCsvWriter.Create('export.csv') do try Write('Field 1 1'); Write('Field 1 2'); Write('Field 1 3'); NextLine; Write('Field 2 1'); Write('Field 2 2'); Write('Field 2 3'); NextLine; Write('Field 3 1'); Write('Field 3 2'); Write('Field 3 3'); finally Free; end;
- Optimized for large data sets
- Customizable field separator
- Flexible CR/LF/CRLF output
- Configurable enclosing character
- Optional whitespace enclosing
- Smart enclosing logic - quotes added only when necessary
- WideString and UnicodeString support
- UTF-8 and Ansi file support
- Supports UTF-8, AnsiString and WideString/UnicodeString data
- Handles lines with differing numbers of fields
- Insert or delete lines and fields with ease
- Cross-platform compatibility - works on Windows, macOS, iOS, Android, and Linux
- Compatible with Delphi/C++Builder versions 6 - 12 and Lazarus 4.2
- Source code included in the full version
- Royalty-free distribution in applications
Order CSV library $60 USD (license for one developer)
Order CSV multi-license $180 USD (license for all developers in company)
Order CSV year upgrades $30 USD (registered users only)
Order CSV year upgrades multi-license $90 USD (registered multi-license users only)