TCSVDocument class
Class representing a CSV document in memory.
Declaration
TCSVDocument = class(TCSVHandler)Inheritance
- TCSVDocument
- TCSVHandler
- TPersistent
- TObject
Description
TCSVDocument can be used to read a CSV file in memory using e.g.
LoadFromFile, manipulate the contents using the
Cells property.
Additional rows can be added using
AddRow,
additional cells can be added using
AddCell.
After all is done, the
SaveToFile method can be used to save the new content to file. The various properties introduced in
TCSVHandler can be used to configure the format of the CSV file.See also
Properties
DetectBOM | public | |
Cells | public | Array access to all cells. |
RowCount | public | Number of available rows. |
ColCount | public | Return the column count for a given row. |
MaxColCount | public | Maximum column count. |
CSVText | public | Return the CSV Document as a single CSV text. |
Methods
Create | public | Create a new instance of TCSVDocument. |
Destroy | public | Remove the TCSVDocument instance from memory. |
LoadFromFile | public | Load a CSV file into the document. |
LoadFromStream | public | Load CSV data from a stream. |
SaveToFile | public | Save to file on disk. |
SaveToStream | public | Save the CSV data to stream. |
AddRow | public | Add a new row to the CSV Data. |
AddCell | public | Add a new cell to a row. |
InsertRow | public | Insert row before row number aRow. |
InsertCell | public | Insert cell at specified position. |
RemoveRow | public | Remove a row. |
RemoveCell | public | Remove a cell at a particular row. |
HasRow | public | Test if a row exists. |
HasCell | public | Test if a cell exists. |
IndexOfCol | public | Test whether a value exists at a given row. |
IndexOfRow | public | Test whether a value exists at a given column. |
Clear | public | Remove all rows. |
CloneRow | public | Duplicate a row. |
ExchangeRows | public | Exchange positions of 2 rows. |
UnifyEmbeddedLineEndings | public | Ensures all values have the same line ending/. |
RemoveTrailingEmptyCells | public | Remove empty cells at the end of each row. |
Inherited
From TCSVHandler (8)
Assign AssignCSVProperties Delimiter EqualColCountPerRow IgnoreOuterWhitespace LineEnding QuoteChar QuoteOuterWhitespace
From TPersistent (7)
AssignTo DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers GetNamePath GetOwner
From TObject (40)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
