How to Append to File in Groovy - Code Snippet

How to perform 'Append to File' in Groovy.

example.groovy
// Task: Append to File
// Language: Groovy

def append_to_file() {
    // Implementation for Append to File
    def result = ...; // Initialize variable
    // TODO: Implement core logic here
    // Step 1: Prepare data
    // Step 2: Process Append to File
    println("Done");
}
AdSense Slot