Joining 3 files together using the unix command

I have three files I want to join using the command line: Crime_Data_2015.csv Crime_Data_2017_1.csv Crime_Data_2016_29.csv

Below is what I have done and what results I get. Does anyone know how to get these three to join and do line count on the combined files.

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat Crime_Data_2015.csv | wc -l 79775

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat Crime_Data_2016_29.csv | wc -l 84417

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ join Crime_Data_2015.csv Crime_Data_2016_29.csv >JoinedFiles.csv

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat JoinedFiles.csv | wc -l 1

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ ls Crime_Data_2015.csv Crime_Data_2017_1.csv LMPD_OP_BIAS_7.csv Crime_Data_2016_29.csv JoinedFiles.csv

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ joined -t, Crime_Data_2015.csv Crime_Data_2016_29.csv >JoinedFiles.csv -bash: joined: command not found

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ join -t, Crime_Data_2015.csv Crime_Data_2016_29.csv >JoinedFiles.csv

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat JoinedFiles.csv | head -5 “INCIDENT_NUMBER”,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,"BLO,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,“BLOCK_ADDRESS”,“CITY”,“ZIP_CODE”,“ID”

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat JoinedFiles.csv “INCIDENT_NUMBER”,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,"BLO,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,“BLOCK_ADDRESS”,“CITY”,“ZIP_CODE”,“ID”

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ join Crime_Data_2015.csv Crime_Data_2016_29.csv “INCIDENT_NUMBER”,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,“BLOCK_ADDRESS”,“CITY”,“ZIP_CODE”,“ID”

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ join -t, Crime_Data_2015.csv Crime_Data_2016_29.csv “INCIDENT_NUMBER”,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,"BLO,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,“BLOCK_ADDRESS”,“CITY”,“ZIP_CODE”,“ID”

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ join Crime_Data_2015.csv Crime_Data_2016_29.csv | join - Crime_Data_2017_1.csv > output.csv

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat output.csv | head -5 “INCIDENT_NUMBER”,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,“BLOCK_ADDRESS”,“CITY”,“ZIP_CODE”,“ID”

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat output.csv “INCIDENT_NUMBER”,“DATE_REPORTED”,“DATE_OCCURED”,“UOR_DESC”,“CRIME_TYPE”,“NIBRS_CODE”,“UCR_HIERARCHY”,“ATT_COMP”,“LMPD_DIVISION”,“LMPD_BEAT”,“PREMISE_TYPE”,“BLOCK_ADDRESS”,“CITY”,“ZIP_CODE”,“ID”

chriskehl@Chriss-MBP:~/Documents/louisville-crime $ cat output.csv

Hi @hashtagkehl,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our community organized so users can more easily find information.

As you’ll notice, your topic is now here in the Project Development Help and Advice board. No action is needed on your part; you can continue the conversation as normal here.

Cheers!