Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
joesan committed Apr 25, 2019
1 parent 7eeb243 commit 1071a47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,25 @@ run and click Run
### Using the parser

This application is built as a standalone jar and published to the OSS Sonatype repos. To add the parser
as a dependency to your project:
as a dependency to your project's build.sbt:

```
libraryDependencies += "com.bigelectrons.csvparser" %% "csv-parser" % version
```

Latest `version`: [![Latest version](https://index.scala-lang.org/bigelectrons/csv-parser/csv-parser/latest.svg)](https://index.scala-lang.org/bigelectrons/csv-parser/csv-parser)

// TODO: Documentation pending
Once added as a dependency, you can use the parser as below:

case class MeterData(meterId: String, dateTime: DateTime, meterReadings: Seq[Double])

val canonicalName = Some(classOf[MeterData].getCanonicalName)
val meterCsvParserCfg = CSVParserConfig(withHeaders = true, caseClassCanonicalName = canonicalName, splitterFn = Some(meterDataSplitter))
val meterCsv = "/Users/joesan/Projects/Private/scala-projects/csv-parser/src/test/resources/meter.csv"
val csvParser1 = CsvParser.apply[MeterData]
val meterDataSeq: Seq[MeterData] = csvParser1.parse(meterCsv, meterCsvParserCfg)

## Built With

* [SBT](http://www.scala-sbt.org/) - Scala Build Tool
Expand Down

0 comments on commit 1071a47

Please sign in to comment.