Skip to content
develop
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

README.md

LTSV4S

LTSV Parser implementation in Scala

Build Status Coverage Status Maven Central

What's LTSV?

http://ltsv.org/

Usage

sbt settings

Add ltsv4s to libraryDependencies.

// if you want to use latest version
// resolvers += "sonatype releases" at "http://oss.sonatype.org/content/repositories/releases"

libraryDependencies += "com.github.seratch" %% "ltsv4s" % "1.0.+"

Example

import com.github.seratch.ltsv4s._

val log: Map[String, String] = LTSV.parseLine("field1:value1\tfield2:value2")
val line: String = LTSV.dump(log)

val logs: List[Map[String, String]] = LTSV.parseLines("field1:value1\tfield2:value2\nfield1:value1\tfield2:value2")
val lines: List[String] = LTSV.dump(logs)

In lenient mode, the parser will allow any character in a field value, apart from tab and newline chars.

val ltsv: Map[String, String] = LTSV.parseLine("name:クリス\tage:28", lenient=true)
ltsv.size should equal(2)
ltsv("name") should equal("クリス")

License

Copyright 2013 - 2015 Kazuhiro Sera

Apache License, Version 2.0

http://www.apache.org/licenses/LICENSE-2.0.html

About

LTSV parser implementation in Scala

Resources

Languages

You can’t perform that action at this time.