Write a CSV file in the current working directory. That for example was previously read by readCSV.
See CSVPrinter for details.
records:
The list of CSVRecord instances to write.
file:
Path to a file in the workspace to write to.
format:
See CSVFormat for details.
Example:
def records = [['key', 'value'], ['a', 'b']]
writeCSV file: 'output.csv', records: records, format: CSVFormat.EXCEL