Class CsvSource<TOutput>

Reads data from a csv source. While reading the data from the file, data is also asnychronously posted into the targets. Data is read a as string from the source and dynamically converted into the corresponding data format.

Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.Csv
Assembly: ETLBox.Csv.dll
Syntax
    public class CsvSource<TOutput> : DataFlowStreamSource<TOutput>, ILoggableTask, IDataFlowLogging, IDataFlowStreamSource<TOutput>, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowStreamSource, IDataFlowExecutableSource, IDataFlowSource, IDataFlowComponent
Type Parameters
NameDescription
TOutput

Type of outgoing data

Examples
CsvSource<CSVData> source = new CsvSource<CSVData>("Demo.csv");
source.Configuration.Delimiter = ";";

Constructors

CsvSource()

Declaration
    public CsvSource()
Examples
CsvSource<CSVData> source = new CsvSource<CSVData>("Demo.csv");
source.Configuration.Delimiter = ";";

CsvSource(string, ResourceType)

Declaration
    public CsvSource(string uri, ResourceType resourceType)
Parameters
TypeNameDescription
stringuri

The source csv file name or uri

ResourceTyperesourceType

Specifies if data is loaded from a file, a web endpoint or other storage types (e.g. Azure Blob Storage)

CsvSource(string)

Declaration
    public CsvSource(string uri)
Parameters
TypeNameDescription
stringuri

The source csv file name or uri

Properties

Configuration

The CsvHelper Configuration. E.g. you can change the delimiter or the escape character here.

Declaration
    public CsvConfiguration Configuration { get; set; }
Property Value
TypeDescription
CsvConfiguration

CsvContext

Gives you access to the CsvHelper CsvContext. You can modify the context before data is read.

Declaration
    public Action<CsvContext> CsvContext { get; set; }
Property Value
TypeDescription
System.Action<T><CsvContext>

FieldHeaders

The parsed header names from the csv

Declaration
    public string[] FieldHeaders { get; }
Property Value
TypeDescription
string[]

IsHeaderRead

True if the header was already set

Declaration
    public bool IsHeaderRead { get; }
Property Value
TypeDescription
bool

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
string
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.CheckParameter()
Examples
CsvSource<CSVData> source = new CsvSource<CSVData>("Demo.csv");
source.Configuration.Delimiter = ";";

CloseReader()

Declaration
    protected override void CloseReader()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.CloseReader()
Examples
CsvSource<CSVData> source = new CsvSource<CSVData>("Demo.csv");
source.Configuration.Delimiter = ";";

InitReader()

Declaration
    protected override void InitReader()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.InitReader()
Examples
CsvSource<CSVData> source = new CsvSource<CSVData>("Demo.csv");
source.Configuration.Delimiter = ";";

ReadAllRecords()

Declaration
    protected override void ReadAllRecords()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.ReadAllRecords()
Examples
CsvSource<CSVData> source = new CsvSource<CSVData>("Demo.csv");
source.Configuration.Delimiter = ";";

ReadFieldHeaders(string)

Reads the header names using the current configuration.

Declaration
    public string[] ReadFieldHeaders(string uri = null)
Parameters
TypeNameDescription
stringuri

Optionally you can override the current configured Uri

Returns
TypeDescription
string[]

An array with the header names

Implements