1
全部。我尝试使用CsvParser解析CSV文件,但在第57行(〜6500)中读取后发生IOException:流关闭错误。有谁知道这可能是什么原因造成的?下面是一段代码和错误:CsvParser流关闭错误
#!/usr/bin/ groovy
package csvTest
@Grab ('com.xlson.groovycsv:groovycsv:1.0')
import com.xlson.groovycsv.CsvParser
def csvFile = new File("file.csv").withReader {
CsvParser.parseCsv(it)
}
csvFile.each {
println it
}
Caught: java.io.IOException: Stream closed
java.io.IOException: Stream closed
at au.com.bytecode.opencsv.CSVReader.getNextLine(CSVReader.java:245)
at au.com.bytecode.opencsv.CSVReader.readNext(CSVReader.java:212)
at au.com.bytecode.opencsv.CSVReader$readNext.call(Unknown Source)
at com.xlson.groovycsv.CsvIterator.hasNext(CsvIterator.groovy:72)
at csvTest.CsvTest.run(CsvTest.groovy:12)
看起来像这样做的伎俩!谢谢! – Jess