TETL 1.1.4
See the version list below for details.
dotnet add package TETL --version 1.1.4
NuGet\Install-Package TETL -Version 1.1.4
<PackageReference Include="TETL" Version="1.1.4" />
paket add TETL --version 1.1.4
#r "nuget: TETL, 1.1.4"
// Install TETL as a Cake Addin
#addin nuget:?package=TETL&version=1.1.4
// Install TETL as a Cake Tool
#tool nuget:?package=TETL&version=1.1.4
TETL
Textfile Extract, Transform and Load is a lightweight .NET library to facilitate text file serialisation to objects, and then on to database endpoints. It is designed to handle large amounts of data by dealing with streams, so it is able to process the file row by row performing operations as required rather than having to have the entire file in memory at any one time.
You might want to use this if using SSIS to load and transform your data isn't practical due to licencing concerns, or you'd rather have a pure .NET solution for a simple ETL task.
Supported Runtimes
- .NET Framework 4.6.1+
Supported Database Targets
- MS SQL Server
Basic usage
Given a text file you wish to deserialize to a .NET object:
Name;Weight;Height
Fred;71.3;165
Andy;80.2;180
Jane;63.5;160
1 First Decorate your class with the TextFileMappingAttribute
public class WeightEntry
{
[TextFileMappingAttribute(ColumnName = "Name")]
public string Name { get; set; }
[TextFileMappingAttribute(ColumnName = "Weight")]
public double Weight { get; set; }
[TextFileMappingAttribute(ColumnName = "Height")]
public int Height { get; set; }
}
2 Create an instance of the TextFileSerializer
TextFileSerializer<WeightEntry> textFileSerializer = new TextFileSerializer<WeightEntry>(@"c:\temp\myTextFile")
{
Delimiter = ";",
FirstRowHeader = true
};
3 Consume the data via enumeration
foreach (WeightEntry data in textFileSerializer)
Console.WriteLine($"Name = {data.Name}, Height = {data.Height}; Weight = {data.Weight}");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.1.4: change of approach for handling quotes.