Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join Subcommand Problem #40

Open
happydentist opened this issue Aug 8, 2021 · 1 comment
Open

Join Subcommand Problem #40

happydentist opened this issue Aug 8, 2021 · 1 comment

Comments

@happydentist
Copy link

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?

@zacharysyoung
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants