CSV export with custom headings
Hello everyone. I have a unique challenge that I'm hoping you can help me solve.
I am using FMP and FM Server to host an inventory management database. Every 30 minutes FM Server runs a script that generates an export CSV file and a CRON job on the server uploads that file to several websites that list our current inventory for sale. The current routine is very script heavy and parses several tables to gather data and dump it all into an Export table before spitting out the CSV file.
Long story short, that system isn't going to work for us anymore because we're adding some different types of items to our inventory. I've managed to write a script that exports all of our new data into a perfect CSV file, the only problem is that the first record needs to have specific headings.
To make matters worse, each website we work with wants these headers to be slightly different (some companies want "items" some say "products").
I've tried several solutions that haven't really worked. The trick is that this file gets generated every 30 minutes, so the solution has to be automated and self contained.
Any help is greatly appreciated, and thank you all in advance!