Ti Ringrazio infinitamente!!!!!!!!!!!!!!
Ho risolto in questo modo
codice:
private static ArrayList<String> getCsvHeadRowExcel (File file, int nRow){
//take reader
Reader readerExcel = new Reader() {
@Override
public int read(char[] buf, int offset, int count) throws IOException {
// TODO Auto-generated method stub
return 0;
}
@Override
public void close() throws IOException {
// TODO Auto-generated method stub
}
};
CSVReader excelReader = new CSVReader(readerExcel, ';');
excelReader = getReaderExcel(file);
ArrayList<String> row = new ArrayList<String>();
try {
String[] nextLine = excelReader.readNext();
// Take an row
for (int j = 0; j < nextLine.length; j++) {
row.add(trimAndLowerCase(nextLine[j]));
}
}
catch (IOException e) {
e.printStackTrace();
row = null;
}
return row;
}
/**
* Take reader to file
*
* @param file
* from with to take reader
*
* @return reader of file
*/
private static CSVReader getReaderExcel(File file) {
CSVReader reader = null;
try {
reader = new CSVReader(new FileReader(file), ';');
return reader;
}
catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
}// end of method
Grazie ancora per l'aiuto, non sai da quanto tempo ci stavo dietro...
Alla prossima