Skip to content

Instantly share code, notes, and snippets.

@chbaranowski
Created June 3, 2011 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chbaranowski/1005960 to your computer and use it in GitHub Desktop.
Save chbaranowski/1005960 to your computer and use it in GitHub Desktop.
Convert a CSV file into another CSV format.
new File("output.csv") withPrintWriter { out ->
new File("input.csv") splitEachLine(';') { fields ->
def name = fields[2]
def firstname = fields[1]
def kto = fields[3]
def blz = fields[4]
def amount = fields[5]
out.println "${name};${firstname} ${name};${kto};${blz};${amount}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment