Skip to content

TCSVDocument.LoadFromFile

Load a CSV file into the document.

Declaration

Source position: csvdocument.pp line 93

public 
procedure LoadFromFile(const AFilename: string);  overload; overload;

procedure LoadFromFile(const AFilename: string; ABufferSize: Integer)
                      ;  overload; overload;

Description

LoadFromFile creates a file stream using aFileName and calls LoadFromStream to read the contents of the file.

The file is read using an internal buffer for efficiency. The size of the buffer can be specified in bytes using ABufferSize. If the size is not specified, a default buffer size is used.

Errors

If the file does not exist, an exception will be raised.

See also

Name Description
LoadFromStream Load CSV data from a stream.
SaveToStream Save the CSV data to stream.
SaveToFile Save to file on disk.