Skip to content

Commit

Permalink
fix for loading CSV conversion table
Browse files Browse the repository at this point in the history
  • Loading branch information
toudi committed Dec 18, 2023
1 parent f656885 commit 21daf67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions internal/sei/input_processors/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ type CSVFormat struct {
}

func CSVDecoder_Init(config csvConfig) (InputProcessor, error) {
return &CSVFormat{
decoder := &CSVFormat{
delimiter: config.Delimiter,
encodingConversionFile: config.EncodingConversionFile,
}, nil
}

if decoder.encodingConversionFile != "" {
decoder.prepareEncodingConversionTable()
}

return decoder, nil
}

func (c *CSVFormat) Process(sourceFile string, parser *parser.Parser) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/sei/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (p *Parser) ProcessLine(fields []string) error {

emptyLine = false

data[header] = value
data[header] = strings.TrimSpace(value)
}

if !emptyLine {
Expand Down

0 comments on commit 21daf67

Please sign in to comment.