Olá Pessoal !
Alguém conhece algum Leitor CSV ?
Preciso ler de um CSV e popular um bean, criando um List.
Alguém conhece algo bom ?
Olá Pessoal !
Alguém conhece algum Leitor CSV ?
Preciso ler de um CSV e popular um bean, criando um List.
Alguém conhece algo bom ?
se não me engano o apache poi faz isso
Já pesquisei, ele não lê CVS. 
Valeu !
Acabei implementando de uma forma que vi em um dos links
public class LeitorCSV {
public BufferedReader carrega(InputStream arquivo) throws FileNotFoundException {
Reader in= new InputStreamReader(arquivo);
return new BufferedReader(in);
}
}
E a classe que a utiliza é
public List<ControleCombustivel> geraLista(InputStream arquivo) throws IOException {
BufferedReader leitor = new LeitorCSV().carrega(arquivo);
String linha;
List<ControleCombustivel> listaCc = new ArrayList<ControleCombustivel>();
while ((linha = leitor.readLine()) != null) {
String conteudo[] = linha.split(";");
ControleCombustivel cc = new ControleCombustivel();
/*.. popula cc e adiciona na lista ...*/
listaCc.add(cc);
}
return listaCc/
}
A Minha dúvida agora é como eu testo a classe LeitorCSV.
Alguém tem alguma dica pra eu deixar ela mais testável ?
Não consegui testa-la de modo simples