Write to CSV file

The following is programming code we frequently use when creating CSV files from Excel.