https://github.com/xta/csviter
golang csv row iterator utility
https://github.com/xta/csviter
csv golang
Last synced: about 1 year ago
JSON representation
golang csv row iterator utility
- Host: GitHub
- URL: https://github.com/xta/csviter
- Owner: xta
- Created: 2017-10-24T21:33:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-24T21:33:50.000Z (over 8 years ago)
- Last Synced: 2025-01-17T08:44:44.859Z (about 1 year ago)
- Topics: csv, golang
- Language: Go
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# CSV Iter
CSV Iter is a wrapper around golang's *encoding/csv* that provides access to the CSV row contents via a channel.
## Usage
`main.go`
package main
import (
"fmt"
csv "github.com/xta/csvIter"
)
func main() {
ch, done := make(chan []string), make(chan bool)
go func() {
for row := range ch {
// do something with the row `[]string`
}
done <- true
}()
if err := csv.Iter("path/to/file.csv", true, ch); err != nil {
fmt.Println("Error", err)
}
close(ch)
<-done
}
## Tests
make