@@ -33,7 +33,7 @@ import (
3333var (
3434 description = `
3535%s processes a CSV file as input returning rows that contain the column
36- with matched text. Columns are count from one instead of zero. Supports
36+ with matched text. Columns are counted from one instead of zero. Supports
3737exact match as well as some Levenshtein matching.
3838`
3939
@@ -42,7 +42,7 @@ Find the rows where the third column matches "The Red Book of Westmarch" exactly
4242
4343 %s -i books.csv -col=2 "The Red Book of Westmarch"
4444
45- Find the rows where the third column (colums numbered 0, 1,2) matches approximately
45+ Find the rows where the third column (colums numbered 1,2,3 ) matches approximately
4646"The Red Book of Westmarch"
4747
4848 %s -i books.csv -col=2 -levenshtein \
@@ -123,7 +123,7 @@ func main() {
123123 app .StringVar (& stopWordsOption , "stop-words" , "" , "use the colon delimited list of stop words" )
124124 app .BoolVar (& skipHeaderRow , "skip-header-row" , true , "skip the header row" )
125125 app .BoolVar (& allowDuplicates , "allow-duplicates" , true , "allow duplicates when searching for matches" )
126- app .BoolVar (& trimSpaces , "trimspaces" , false , "trim spaces around cell values before comparing" )
126+ app .BoolVar (& trimSpaces , "trimspace, trimspaces" , false , "trim spaces around cell values before comparing" )
127127
128128 // Parse env and options
129129 app .Parse ()
@@ -214,6 +214,9 @@ func main() {
214214 if caseSensitive == false {
215215 src = strings .ToLower (src )
216216 }
217+ if trimSpaces == true {
218+ src = strings .TrimSpace (src )
219+ }
217220 if len (stopWords ) > 0 {
218221 // Split into fields applying datatools filter
219222 fields := strings .FieldsFunc (src , func (c rune ) bool {
0 commit comments