I want to pre-append some text a a CSV file that is created by MySQL.
Basically I want to add the header information for the rows so when the user opens it in Excel they know what each column is.
Whats the best way to do this. I presume there is some easy linux command that can do this? I can also do it in the PHP script. I’d like to know how to do both just for educational purposes.
General setup:
Debian Etc
LAMP website
Cron calls a PHP script which creates the csv file every night.
Thanks,
Derek
You can do for example this:
echo prints the header, cat takes this header from standard input and writes it together with everything from data.csv then into dataInfo.csv