From 97fde644614c2cc51c0388e6fb28b0bc59b36550 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 4 Dec 2024 23:11:51 +0530 Subject: [PATCH] Make CSV (import) header fields agnostic of surrounding spaces. Closes #2189. --- internal/subimporter/importer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/subimporter/importer.go b/internal/subimporter/importer.go index 5a41bf1e..a9a1a2ed 100644 --- a/internal/subimporter/importer.go +++ b/internal/subimporter/importer.go @@ -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