Skip to content

Commit

Permalink
Make CSV (import) header fields agnostic of surrounding spaces. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Dec 4, 2024
1 parent 6371228 commit 97fde64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/subimporter/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ func (s *Session) mapCSVHeaders(csvHdrs []string, knownHdrs map[string]bool) map
hdrKeys := make(map[string]int)
for i, h := range csvHdrs {
// Clean the string of non-ASCII characters (BOM etc.).
h := regexCleanStr.ReplaceAllString(h, "")
h := regexCleanStr.ReplaceAllString(strings.TrimSpace(h), "")
if _, ok := knownHdrs[h]; !ok {
s.log.Printf("ignoring unknown header '%s'", h)
continue
Expand Down

0 comments on commit 97fde64

Please sign in to comment.