Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cristalhq/dsvreader
Fast reader for delimiter-separated data
https://github.com/cristalhq/dsvreader
csv csv-reader dependency-free dsv dsv-reader go golang tsv tsv-reader
Last synced: about 2 months ago
JSON representation
Fast reader for delimiter-separated data
- Host: GitHub
- URL: https://github.com/cristalhq/dsvreader
- Owner: cristalhq
- License: mit
- Created: 2019-06-29T17:03:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-08T10:29:19.000Z (10 months ago)
- Last Synced: 2024-03-08T11:39:29.169Z (10 months ago)
- Topics: csv, csv-reader, dependency-free, dsv, dsv-reader, go, golang, tsv, tsv-reader
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dsvreader
[![build-img]][build-url]
[![pkg-img]][pkg-url]
[![version-img]][version-url]Fast reader for delimiter-separated data in Go.
## Features
* Supports CSV, TSV, PSV.
* Supports user defined delimiter.
* Dependency-free.
* Optimized for speed.
* Based on [Aliaksandr Valialkin's TSVReader](https://github.com/valyala/tsvreader)See [docs][pkg-url].
## Install
Go version 1.17+
```
go get github.com/cristalhq/dsvreader
```## Example
```go
bs := bytes.NewBufferString(
`foo\t42\n
bar\t123\n`)r := dsvreader.NewTSV(bs)
for r.Next() {
col1 := r.String()
col2 := r.Int()
fmt.Printf("col1=%s, col2=%d\n", col1, col2)
}if err := r.Error(); err != nil {
panic("unexpected error: %s", err)
}
```See examples: [example_test.go](example_test.go).
## License
[MIT License](LICENSE).
[build-img]: https://github.com/cristalhq/dsvreader/workflows/build/badge.svg
[build-url]: https://github.com/cristalhq/dsvreader/actions
[pkg-img]: https://pkg.go.dev/badge/cristalhq/dsvreader
[pkg-url]: https://pkg.go.dev/github.com/cristalhq/dsvreader
[version-img]: https://img.shields.io/github/v/release/cristalhq/dsvreader
[version-url]: https://github.com/cristalhq/dsvreader/releases