Class ExcelTextFormatFixedWidthBase
Describes how to import a fixed width text file.
Inheritance
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelTextFormatFixedWidthBase : ExcelTextFileFormat
Properties
Columns
The collection of column formats.
Declaration
public EPPlusReadOnlyList<ExcelTextFormatColumn> Columns { get; set; }
Property Value
Type | Description |
---|---|
EPPlusReadOnlyList<ExcelTextFormatColumn> |
FormatErrorStrategy
The strategy to use when writing fixed width text files.
Declaration
public FixedWidthFormatErrorStrategy FormatErrorStrategy { get; set; }
Property Value
Type | Description |
---|---|
FixedWidthFormatErrorStrategy |
LineLength
The length of the line to read. If set to widths, LineLength is sum of all columnLengths. If set to positions, LineLength is set to the value of the last index of columnLengths
Declaration
public int LineLength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PaddingCharacter
Padding character for Text Can be set to null to skip trimming padding characters when reading
Declaration
public char PaddingCharacter { get; set; }
Property Value
Type | Description |
---|---|
System.Char |
PaddingCharacterNumeric
Padding character for numbers.
Declaration
public char? PaddingCharacterNumeric { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Char> |
Methods
ClearColumnFormats()
Clear the collection of column formats.
Declaration
public void ClearColumnFormats()
SetColumnDataTypes(eDataTypes[])
Set the data types for each column.
Declaration
public void SetColumnDataTypes(params eDataTypes[] dataTypes)
Parameters
Type | Name | Description |
---|---|---|
eDataTypes[] | dataTypes |
SetColumnLengths(Int32[])
Set the column length properties of fixed width text. For reading to end of line, set last index to 0 or a negative number.
Declaration
public void SetColumnLengths(params int[] lengths)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | lengths |
SetColumnPaddingAlignmentType(PaddingAlignmentType[])
Set the padding type for each column.
Declaration
public void SetColumnPaddingAlignmentType(params PaddingAlignmentType[] paddingTypes)
Parameters
Type | Name | Description |
---|---|---|
PaddingAlignmentType[] | paddingTypes |
SetColumnPositions(Int32, Int32[])
Set the column start positions of fixed width text.
Declaration
public void SetColumnPositions(int lineLength, params int[] positions)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineLength | The Length of a line. Set to 0 or negative to read until end of line. |
System.Int32[] | positions | The positions where each column starts. This array requires atleast one element. |
SetColumnsNames(String[])
Set flag for each column to be used.
Declaration
public void SetColumnsNames(params string[] Names)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Names |
SetUseColumns(Boolean[])
Set flag for each column to be used.
Declaration
public void SetUseColumns(params bool[] UseColumns)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean[] | UseColumns |