You could also use a tool specifically designed for joining csv files, such as the one found on https://filerefinery.com
The operations we currently support are: Joining csv files. It is possible to perform the SQL equivalent of outer, inner, left and right join operations on two csv files. Which column will be used as a join key in each of the files is configurable.