seratch / ltsv4s   1.0.3

Apache License 2.0 GitHub

LTSV parser implementation in Scala

Scala versions: 2.11 2.10


LTSV Parser implementation in Scala

Build Status Coverage Status Maven Central

What's LTSV?


sbt settings

Add ltsv4s to libraryDependencies.

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


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("クリス")

How to release this library

sbt test
sbt ++publishSigned sonatypeBundleRelease


Copyright 2013 - Kazuhiro Sera

Apache License, Version 2.0