gocsv
gocsv copied to clipboard
Join Subcommand Problem
I use gocsv join subcommand with 2 csv files, but only for one column condition. If more than one column to be join with, it failed. How to join 2 csv files with multiple columns condition?
@happydentist, you can use the add
command and a template to create a composite column of the two columns you want to join on, for both files:
gocsv add -name 'Join_col' - t '{{ .Col_A }} --- {{ .Col_B }}' File1.csv
gocsv add -name 'Join_col' - t '{{ .Col_C }} --- {{ .Col_D }}' File2.csv
gocsv join -c 'Join_col' File1.csv File2.csv