To tentando comparar linhas e colunas de um arquivo xls. Eu consigo ler o arquivo só que ele não compara tudo, o que eu faço? (Estou usando JXL)
Aqui esta o código
class Permanente {
Cell[] cel,cel2;
Cell eu,tu;
String a,b,conteud,conteudo;
int i,ka,j;
Label d;
ComJXL com;
int linhas,colu;
Novamente nov;
public Permanente() {
try {
j=0;
ka=1;
Workbook workbook = Workbook.getWorkbook(new File("/home/acene/Documentos/composicao3.xls"));
String filename = "/home/acene/Documentos/entradawwww.xls";
WorkbookSettings ws = new WorkbookSettings();
ws.setLocale(new Locale("en", "EN"));
WritableWorkbook workbookttt = Workbook.createWorkbook(new File(filename), ws);
WritableSheet s = workbookttt.createSheet("Folha1", 0);
Sheet sheet = workbook.getSheet(0);
linhas = sheet.getRows();
colu = sheet.getColumns();
for(int i = 0;i<linhas;i++){
for(int j=0;j<colu;j++){
eu=sheet.getCell(j,i);
} if(sheet.getCell(3,j).getContents().equals("")){
}else{
if (sheet.getCell(3,i).getContents().equals(sheet.getCell(4,i).getContents())) {
System.out.println(sheet.getCell(3,i).getContents()+" -OK- "+sheet.getCell(4,i).getContents());
WritableCellFormat cf2 = new WritableCellFormat();
Label label = new Label(6,i, "OK", cf2);
s.addCell(label);
}
}
}
for(int j=0;j<colu;j++){
for(int i = 0;i<linhas;i++){
cel2=sheet.getColumn(j);
conteudo= cel2[i].getContents();
WritableCellFormat cf1 = new WritableCellFormat();
Label label2 = new Label(j,i, conteudo, cf1);
s.addCell(label2);
if((sheet.getCell(3,j).getContents().equals(""))||(sheet.getCell(4,i).getContents().equals(""))){
}else{
if (sheet.getCell(3,j).getContents().equals(sheet.getCell(4,i).getContents())) {
System.out.println(sheet.getCell(3,j).getContents()+" -OK- "+sheet.getCell(4,i).getContents());
WritableCellFormat cf8 = new WritableCellFormat();
Label label1 = new Label(6,i, "OK", cf8);
s.addCell(label1);
}
}
}
}
workbookttt.write();
workbookttt.close();
} catch (Exception e) {
}
}
}