Class TextSource<TOutput>
Reads data from a text file. Each line is read as a string and converted into an object by the ParseLineFunc. A line is defined as a sequence of characters followed by a line feed("\n"), a carriage return ("\r"), or a carriage return immediately followed by a line feed("\r\n").
Inheritance
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public class TextSource<TOutput> : DataFlowStreamSource<TOutput>, IDataFlowLogging, IDataFlowStreamSource<TOutput>, IDataFlowExecutableSource<TOutput>, IDataFlowStreamSource, IDataFlowExecutableSource, ILoggableTask, IDataFlowSource<TOutput>, IDataFlowSource, IDataFlowComponent
Type Parameters
Name | Description |
---|---|
TOutput | Type of outgoing data. |
Constructors
TextSource()
Declaration
public TextSource()
TextSource(string, Func<string, int, TOutput>)
Declaration
public TextSource(string uri, Func<string, int, TOutput> parseLineFunc)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The source of the file. This can be a filename or a web url.System.Uri |
System.Func<T1, T2, TResult><string, int, TOutput> | parseLineFunc |
TextSource(string)
Declaration
public TextSource(string uri)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The source of the file. This can be a filename or a web url.System.Uri |
Properties
ParseLineFunc
This Function is called for every line in the source document. The input is the current read line as as string and the current progress count. The return value is the new row that is send into the connected components.
Declaration
public Func<string, int, TOutput> ParseLineFunc { get; set; }
Property Value
Type | Description |
---|---|
System.Func<T1, T2, TResult><string, int, TOutput> |
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
Type | Description |
---|---|
string |
Overrides
Methods
CheckParameter()
Declaration
protected override void CheckParameter()
Overrides
CloseReader()
Declaration
protected override void CloseReader()
Overrides
InitReader()
Declaration
protected override void InitReader()
Overrides
ReadAllRecords()
Declaration
protected override void ReadAllRecords()