def file= new File(path + 'fileName.csv');
List.unique().each { element ->
file<< element << newLine
}
Now the script is appending the file But i want to clear all the data and over write the fileName.csv if it already exists If the file doesn't exists, create the file and write data to file.
Aucun commentaire:
Enregistrer un commentaire