Imports a text file into an Excel file.
procedure LoadFromTextDelim(const InStream: TStream; const Workbook: TExcelFile; const Delim: UTF16Char; const FirstRow: integer; const FirstCol: integer; const ColumnFormats: array of XLSColumnImportTypes; const Encoding: TEncoding; const DetectBOM: Boolean = false); overload;
LoadFromTextDelim(const TStream InStream, const TExcelFile Workbook, const UTF16Char Delim, const int FirstRow, const int FirstCol, const array of XLSColumnImportTypes ColumnFormats, const TEncoding Encoding, const Boolean DetectBOM = false);
|
Parameters |
Description |
|
const InStream: TStream |
Stream with the text delimited file you want to import. |
|
const Workbook: TExcelFile |
Excel file where there data will be imported. |
|
const Delim: UTF16Char |
Delimiter used in the file. This is normally ",", ";" in csv files or #9 (tab) in tab delimited files. |
|
const FirstRow: integer |
First row where the data will be imported. (1 based) |
|
const FirstCol: integer |
First column where the data will be imported (1 based) |
|
const ColumnFormats: array of XLSColumnImportTypes |
Array of import types specifying how to import each column. |
|
const Encoding: TEncoding |
Encoding used in the text file. (UTF8, Unicode, etc). |
|
const DetectBOM: Boolean = false |
If true, FlexCel will try to detect the encoding from the BOM (Byte order mark) in the file. Set it to true if the files have BOM. |
Normally you can just use TFlexCelImport.OpenFile Method to import csv files, but this method gives you a little more control, like the row and column where to import the data.
This overload of the method is only available in Delphi 2009 or newer.
|
Copyright (c) 2002-2008 TMS Software. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|