Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpkn/hashy
Hash tables from csv data with ease
https://github.com/tpkn/hashy
Last synced: 6 days ago
JSON representation
Hash tables from csv data with ease
- Host: GitHub
- URL: https://github.com/tpkn/hashy
- Owner: tpkn
- License: mit
- Created: 2021-07-14T17:29:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-24T17:04:49.000Z (over 3 years ago)
- Last Synced: 2024-11-14T14:32:25.875Z (2 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hashy
Hash tables from csv data with ease## Usage
Convert csv to a hash map:
```go
import (
"fmt"
"github.com/tpkn/hashy"
)var options = hashy.Options{
Input: "./test/file.csv",
KeyColumns: []int{ 0, 12, 45 },
IncludeKeysValues: false,
Delimiter: ',',
SkipHeader: true,
LazyQuotes: false,
}var hash, err = hashy.File(options)
if err != nil {
panic(err)
}for key, val := range hash {
fmt.Println(key)
for _, f := range val {
fmt.Println("\t", fmt.Sprintf("%q", f))
}
}
```To make a flat hash map (one key - one value):
```go
var hash, err = hashy.FileFlat(options)
```