ok grazie milleOriginariamente inviato da Andrea1979
se mi dai una mezz'ora vedo che posso fare. Poi l'api te la scarichi tu. Devo consegnare una cosa, poi ti scrivo un pezzo di codice.
EDIT
Apre un file excel, lo legge per riga e colonna: se trova una cella vuota salta alla riga successiva e si ferma se la prima cella di una riga è vuota. Il tutto viene messo, riga a riga, in un file di testo.codice:import jxl.*; import java.io.*; public class ReadToText { public static void main (String[] args) throws Exception { String buff = ""; //apro il file Workbook workbook = Workbook.getWorkbook(new File("C:/Documents and Settings/Andrea/Desktop/demofile.xls")); //prendo il primo foglio Sheet sheet = workbook.getSheet(0); boolean flag1 = true; boolean flag2 = true; int riga = 0; Cell currentCell; while (flag1) { //leggo per righe int cella = 0; while (flag2) { //leggo le celle currentCell = sheet.getCell(cella, riga); flag2 = currentCell.getContents()== "" ? false : true; buff += currentCell.getContents(); cella++; } buff += "\n"; cella = 0; riga++; flag2 = true; currentCell = sheet.getCell(cella, riga); flag1 = currentCell.getContents() == "" ? false : true; } BufferedWriter br = new BufferedWriter(new FileWriter("C:/Documents and Settings/Andrea/Desktop/EXCEL.TXT")); br.write(buff); br.flush(); br.close(); } }

Rispondi quotando