csv4j CSV 文字コード指定して読むならば、CSVFileProcessor ではなくて、
CSVStreamProcessor を使う
CSVFileProcessor の processFile で CSVLineProcessor を与えたのと同様に、InputStreamReader で
文字コード指定してやればよい。
CSVStreamProcessor processor = new CSVStreamProcessor();
processor.processStream(new InputStreamReader(new FileInputStream("a.csv"),"UTF-8")
,new CSVLineProcessor(){
Map<String,Integer> map = new HashMap<String,Integer>();
public void processHeaderLine( final int linenumber, final List<String> fieldNames ){
int ix=0;
for(String fieldName : fieldNames){
this.map.put(fieldName,ix);
ix++;
}
}
public void processDataLine(final int linenumber,final List<String> fieldValues ){
// "A" カラム取得
System.out.println(fieldValues.get(this.map.get("A")));
}
public boolean continueProcessing(){
return true;
}
});