Export posts to csv with data from ACF custom fields

Lol. I got reminded of this question when I got the Tumbleweed badge for having no answers and low views for a week.

I didn’t figure out the right method for this but hacked through it by printing out the posts in a table format on the archive page for this custom post type and used a jQuery script from: http://www.jqueryscript.net/table/Export-Html-Table-To-Excel-Spreadsheet-using-jQuery-table2excel.html to output the table into excel format. Not the cleanest method ‘cos I found some values weren’t formatted as proper cells but had to use this method since this was an urgent requirement.