Write a CSV file in the current working directory. That for example was previously read by readCSV. See CSVPrinter for details.

Fields:

Example:

def records = [['key', 'value'], ['a', 'b']]
writeCSV file: 'output.csv', records: records, format: CSVFormat.EXCEL