def data = [
['id', 'Task', 'Name', 'Description'],
['1', 'Create', 'Jira', 'System Project'],
['2', 'Read', 'Confluence', 'Wiki'],
['3', 'Update', 'SharePoint', 'Portal']
]
def file = new File("C:/Temp/data.csv")
def stringBuilder = new StringBuilder()
data.each { row ->
stringBuilder.append(row.join(';')).append(System.lineSeparator())
}
file.text = stringBuilder.toString()
Result:
Happy Coding!