Skip to content

Commit 071329a

Browse files
committed
Create README.md
1 parent 2558d06 commit 071329a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# go-csv
2+
3+
This tiny tool now provides the following functionalities:
4+
- Automatically detects the CSV delimiter. It fully conforms to the specifications outlined on the on the [Wikipedia article][csv].
5+
6+
[csv]: http://en.wikipedia.org/wiki/Comma-separated_values
7+
8+
## Usage
9+
10+
package main
11+
12+
import (
13+
"github.com/csimplestring/go-csv/detector"
14+
"os"
15+
"fmt"
16+
)
17+
18+
func main() {
19+
detector := detector.New()
20+
21+
file, err := os.OpenFile("example.csv", os.O_RDONLY, os.ModePerm)
22+
if err != nil {
23+
os.Exit(1)
24+
}
25+
defer file.Close()
26+
27+
delimiters := detector.DetectDelimiter(file, '"')
28+
fmt.Println(delimiters)
29+
}
30+
31+
This tool is inspired by [parseCSV][link].
32+
[link]: https://github.com/parsecsv/parsecsv-for-php

0 commit comments

Comments
 (0)