Skip to content

Commit

Permalink
toListMap method to convert to Beaker compatible format
Browse files Browse the repository at this point in the history
  • Loading branch information
ssadedin committed Jan 16, 2017
1 parent 9f566e0 commit 25090e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/groovy/graxxia/TSV.groovy
Expand Up @@ -257,6 +257,10 @@ class TSV implements Iterable {
static getReader(String fileName) { static getReader(String fileName) {
fileName.endsWith(".gz") ? new GZIPInputStream(new FileInputStream(fileName)).newReader() : new File(fileName).newReader() 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 { class CSV extends TSV {
Expand Down

0 comments on commit 25090e3

Please sign in to comment.