Skip to content

seratch/ltsv4s

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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.

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

How to release this library

sbt test
sbt ++publishSigned sonatypeBundleRelease

License

Copyright 2013 - Kazuhiro Sera

Apache License, Version 2.0

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

About

LTSV parser implementation in Scala

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages