我有一个以alt代码分隔的csv文件。 " Alt 26"或者→签名。
this.delimiter = '→';
CsvReader reader = new CsvReader(inputStreamReader, this.delimiter);
for (int i = 0; i < reader.getHeaderCount(); i++) {
//header fields is no being seperated as per delimiter specified.
}
上面的代码不会起作用,因为标题/字段没有被分隔。知道如何更换它们吗?
答案 0 :(得分:0)
尝试使用UTF-8编码打开文件:
inputStreamReader = new InputStreamReader(new FileInputStream("d:\\a.csv"), "UTF-8"),
喜欢这个问题: Parse CSV file containing a Unicode character using OpenCSV