The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_replist
Class: TRLData
Declaration: function ImportCSV (FName: String; Delimiter: TCSVDelimiters; IncludeColHeaders: boolean): integer;

The method ImportCSV reads the contents of the CSV file FName. The delimiting character is specfied by the parameter Delimiter.

If the parameter IncludeColHeaders is true the first line of the CSV file is interpreted as column headers.

The method returns the following error codes:

 0 ... everything is OK
-1 ... file not found

Hint 1: Please note that the CSV format has never been standardized, and thus a plethora of different sub-versions exists. Further, the decimal separator and the thousand separator character change between different languages, contributing to even greater confusion. For example, in German implementations the comma is replaced by the semicolon in order to be able to use the comma as a decimal separator. Thus the selection of the delimiter depends on the system which will be used to read the CSV file.

Last Update: 2017-Nov-22