Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelhg committed Oct 7, 2022
1 parent 4e5e675 commit 3def35d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (p *Parser) ParseDataDense(reader *bufio.Reader, writer *bufio.Writer) {
if c == '"' {
quotes += 1

} else if c == ' ' || c == '\n' || c == '\r' {
} else if c == ' ' || c == '\n' || c == '\r' || c == ';' {
if bufLength > 0 {
values[currentValue] = buf.String()
buf.Reset()
Expand All @@ -84,7 +84,6 @@ func (p *Parser) ParseDataDense(reader *bufio.Reader, writer *bufio.Writer) {
if currentValue == headingWidth {
stubs, _ := stubFlattener.Next()
writer.WriteByte('"')
// writer.WriteString(strings.Join(stubs, "\";\""))
for i, s := range stubs {
writer.WriteString(s)
if i < stubWidth-1 {
Expand All @@ -95,7 +94,6 @@ func (p *Parser) ParseDataDense(reader *bufio.Reader, writer *bufio.Writer) {
}
writer.WriteByte('"')
writer.WriteByte(';')
//writer.WriteString(strings.Join(values, ";"))
for i, s := range values {
writer.WriteString(s)
if i < headingWidth-1 {
Expand All @@ -105,7 +103,7 @@ func (p *Parser) ParseDataDense(reader *bufio.Reader, writer *bufio.Writer) {
writer.WriteByte('\n')
currentValue = 0
}
} else if c != ';' {
} else {
buf.WriteByte(c)
bufLength += 1
}
Expand Down

0 comments on commit 3def35d

Please sign in to comment.