Skip to content

Just simple C# implementation of LTSV (Labeled Tab-separated Values).

Notifications You must be signed in to change notification settings

ne-sachirou/LTSV.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LTSV.NET

Just simple C# (.NET) implementation for LTSV (Labeled Tab-separated Values).

Install

Install from NuGet (NuGet Gallery | LTSV.NET).

PM> Install-Package LTSV

Usage

Using namespace.

using LTSV;

Parse an LTSV record.

Ltsv.ParseLine("time:28/Feb/2013:12:00:00 +0900\thost:192.168.0.1\treq:GET /list HTTP/1.1\tstatus:200\n");
// => new Dictionary<string, string>
//    {
//        { "time", "28/Feb/2013:12:00:00 +0900" },
//        { "host", "192.168.0.1" },
//        { "req", "GET /list HTTP/1.1" },
//        { "status", "200" }
//    };

Build an LTSV record.

Ltsv.BuildLine(new Dictionary<string, string>
    {
        { "time", "28/Feb/2013:12:00:00 +0900" },
        { "host", "192.168.0.1" },
        { "req", "GET /list HTTP/1.1" },
        { "status", "200" }
    });
// => "time:28/Feb/2013:12:00:00 +0900\thost:192.168.0.1\treq:GET /list HTTP/1.1\tstatus:200"

Parse LTSV.

var ltsvStr = "hunter:sAccan\tmOmonga:10\nhunter:lotus_gate\tmOmonga:1e6";
new Ltsv(ltsvStr).Records;
new Ltsv().Parse(ltsvStr).Records;

Build LTSV.

var ltsv = new Ltsv("hunter:sAccan\tmOmonga:10\nhunter:lotus_gate\tmOmonga:1e6");
Console.WriteLine(ltsv.ToString());

License

(Public Domain)2013 ne_Sachirou <utakata.c4se@gmail.com>

About

Just simple C# implementation of LTSV (Labeled Tab-separated Values).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published