LinearTsvParser 1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package LinearTsvParser --version 1.0.0
NuGet\Install-Package LinearTsvParser -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LinearTsvParser" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinearTsvParser" Version="1.0.0" />
<PackageReference Include="LinearTsvParser" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LinearTsvParser --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LinearTsvParser, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LinearTsvParser@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LinearTsvParser&version=1.0.0
#tool nuget:?package=LinearTsvParser&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Linear TSV Parser
NuGet package
Examples
Reading a .tsv.gz file:
using System.IO;
using System.IO.Compression;
using System.Collections.Generic;
using LinearTsvParser;
public class Example {
public void ReadTsv() {
using (var input = File.OpenRead("/tmp/test.tsv"))
using (var gzip = new GZipStream(input, CompressionMode.Decompress))
using (var tsvReader = new TsvReader(input)) {
while(!tsvReader.EndOfStream) {
List<string> fields = tsvReader.ReadLine();
}
}
}
}
Writing a tsv.gz file:
using System.IO;
using System.IO.Compression;
using System.Collections.Generic;
using LinearTsvParser;
public class Example {
public void WriteTsv() {
using (var outfile = File.Create("/tmp/test.tsv"))
using (var gzip = new GZipStream(outfile, CompressionMode.Compress))
using (var tsvWriter = new TsvWriter(gzip)) {
foreach(List<string> fields in data) {
tsvWriter.WriteLine(fields);
}
}
}
}
The Linear TSV format
- Fields are separated by TAB characters
- Text encoding is
UTF-8 - The reader can parse lines with any of these three endings:
\n,\r\n,\r - The writer is restricted to output only the
\ncharacter as EOL - Special characters inside the fields are replaced:
- Newline ⇒
"\n" - Carriage return ⇒
"\r" - Tab ⇒
"\t" "\"(backslash) ⇒"\\"
- Newline ⇒
Benchmark
The benchmark test compares the performace of this library with "native" solutions, which use string replace operations. The solution with string replace (native) uses slightly more memory and is a bit slover than this library (lib). The benchmark test can be found here: BenchTest.cs
| Method | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| LibReadTest | 275.5 ms | 7.15 ms | 21.08 ms | 62.31 MB |
| NativeReadTest | 309.8 ms | 10.08 ms | 29.26 ms | 66.66 MB |
| LibWriteTest | 110.8 ms | 2.81 ms | 8.25 ms | 23.52 MB |
| NativeWriteTest | 195.9 ms | 4.16 ms | 11.99 ms | 36.06 MB |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- BenchmarkDotNet (>= 0.12.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LinearTsvParser:
| Package | Downloads |
|---|---|
|
FatCatDB
Zero configuration, high performance database library for ETL workflows |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.7 | 6,746 | 1/18/2020 |
| 1.1.6 | 736 | 1/14/2020 |
| 1.1.5 | 629 | 1/14/2020 |
| 1.1.4 | 677 | 1/12/2020 |
| 1.1.3 | 708 | 1/12/2020 |
| 1.1.2 | 675 | 1/12/2020 |
| 1.1.1 | 703 | 1/12/2020 |
| 1.1.0 | 710 | 1/12/2020 |
| 1.0.7 | 632 | 1/12/2020 |
| 1.0.6 | 630 | 1/12/2020 |
| 1.0.5 | 678 | 1/12/2020 |
| 1.0.4 | 668 | 1/12/2020 |
| 1.0.3 | 672 | 1/12/2020 |
| 1.0.2 | 712 | 1/12/2020 |
| 1.0.1 | 775 | 1/11/2020 |
| 1.0.0 | 760 | 1/11/2020 |