Permalink
Browse files

toListMap method to convert to Beaker compatible format

  • Loading branch information...
ssadedin committed Jan 16, 2017
1 parent 9f566e0 commit 25090e3ad360d82feccc04860ee67ec651e40b0c
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/main/groovy/graxxia/TSV.groovy
@@ -257,6 +257,10 @@ class TSV implements Iterable {
static getReader(String fileName) {
fileName.endsWith(".gz") ? new GZIPInputStream(new FileInputStream(fileName)).newReader() : new File(fileName).newReader()
}
List<Map> toListMap() {
this.collect { [ it.columns*.key, it.values ].transpose().collectEntries() }
}
}
class CSV extends TSV {

0 comments on commit 25090e3

Please sign in to comment.