Table of Contents

ExcelFile.Import Method

Overloads

ExcelFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[])

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats)

Parameters

<-> Parameter Type Description
aTextReader TextReader StreamReader with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
columnWidths Int32[] An array with the column widths for every column you want to import.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.

See also

ExcelFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public abstract void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats)

Parameters

<-> Parameter Type Description
aTextReader TextReader StreamReader with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
columnWidths Int32[] An array with the column widths for every column you want to import.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.

See also

ExcelFile.Import(String, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
fileName String File with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(Stream, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
aStream Stream Stream with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public abstract void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats)

Parameters

<-> Parameter Type Description
aTextReader TextReader TextReader with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
textQualifier Char Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.

See also

ExcelFile.Import(String, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
fileName String File with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
columnWidths Int32[] An array with the column widths for every column you want to import.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(Stream, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
aStream Stream Stream with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
columnWidths Int32[] An array with the column widths for every column you want to import.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(String, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
fileName String File with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(Stream, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
aStream Stream Stream with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(String, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
fileName String File with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
columnWidths Int32[] An array with the column widths for every column you want to import.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(Stream, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
aStream Stream Stream with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
columnWidths Int32[] An array with the column widths for every column you want to import.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(String, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
fileName String File with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
textQualifier Char Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

ExcelFile.Import(Stream, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> Parameter Type Description
aStream Stream Stream with the text to import.
firstRow Int32 Row in the Active sheet where we will start importing the text file.
firstCol Int32 Column in the Active sheet where we will start importing the text file.
delimiter Char Character used to separate columns.
textQualifier Char Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
columnFormats ColumnImportType[] An array of ColumnImportType elements, telling how each column should be imported.
See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
dateFormats String[] A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
fileEncoding Encoding Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
detectEncodingFromByteOrderMarks Boolean It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also