CSVFIX has been my go to for command line ETL but I have always run it on Windows. After running in to some issues with a CSV file loading in to Salesforce I needed something on the mac to ‘peak’ in to the file and do the usual amount of stuff that I’m used to doing with CSVFIX. A quick google search and I find some handy instructions but nothing is ever easy and because the internet sometimes comes and goes I’m putting those here with the changes I made to work on Mac (vs. Linux) and a couple of the apps I had to update or install.
Here’s the list of commands:
- wget https://bitbucket.org/neilb/csvfix/get/version-1.6.zip
- unzip version-1.6.zip
- cd neilb-csvfix-e804a794d175
- make lin
- cd csvfix/bin
- sudo cp csvfix /usr/local/bin
Wget by default is not on the mac. I used “brew install wget” to install it. It is a handy package manager that is specifically for Mac: https://brew.sh/
On step #4 when you try and ‘Make’ or compile you might get this error:
- xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
To fix this run: xcode-select –install and that installation will fix the error and allow you to compile/make csvfix.
The last thing that I changed from the original instructions is to update step #6 from /usr/bin to /usr/local/bin which is specific to mac (vs Linux).
Here is the link to the blog post that started this journey: Install csvfix on linux