Skip to content

Commit

Permalink
Support multiple delimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonRomano committed Nov 11, 2018
1 parent c45753c commit 2bf7476
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type CSV struct {
Data io.ReadCloser
IgnoreRows []int
Row Row
Delimiter rune
}

func Consume(csvDefinition CSV) error {
Expand All @@ -30,6 +31,9 @@ func Consume(csvDefinition CSV) error {

// New CSV Reader
reader := csv.NewReader(csvDefinition.Data)
if csvDefinition.Delimiter != 0 {
reader.Comma = csvDefinition.Delimiter
}
records, err := reader.ReadAll()
if err != nil {
return err
Expand Down

0 comments on commit 2bf7476

Please sign in to comment.