사용자 도구

사이트 도구


groovy:csv

Groovy CSV

  • CSV 참조.
  • 간단한 예
    @Grapes(
        @Grab(group='com.opencsv', module='opencsv', version='4.1')
    )
    import com.opencsv.*
    Writer writer = new StringWriter()
    CSVWriter csvWriter = new CSVWriter(writer,
                        CSVWriter.DEFAULT_SEPARATOR, // tab일경우 (char) '\t'
                        CSVWriter.DEFAULT_QUOTE_CHARACTER,
                        CSVWriter.DEFAULT_ESCAPE_CHARACTER,
                        CSVWriter.DEFAULT_LINE_END)
    csvWriter.writeNext(['Title1', 'Title2', 'Title3', 'Title4'] as String[])
    csvWriter.writeNext(['value1', 'value2', 'value3', 'value4'] as Strign[])
    ...
    csvWriter.close()
    println writer.toString()
groovy/csv.txt · 마지막으로 수정됨: 2018/03/26 14:19 저자 kwon37xi