quali sono i comandi per gestire i file di testo in java?
quali sono i comandi per gestire i file di testo in java?
Giuseppe SPECCHIO
beh c'č la classe File appartenente all'IO con cui puoi leggere e scrivere su file...
[Homepage] [Contattami]
Powered by: Ubuntu - Debian - Gentoo
Developing: Java - C++ - PHP
[supersaibal]"Perchč tanto Debian č meglio"[/supersaibal]
File costruisce un file o directory
FileReader e FileWriter leggono e scrivono i file
E per finire tutte le classi Stream gestiscono i file binari.
Ora sai tutto!
... mi servirebbe cortesemente un esempio d'uso!!
Giuseppe SPECCHIO
Non starai chiedendo troppo?
www.mokabyte.com
![]()
e se invece di voler salvare in file in txt si volesse salvarlo in exel???
Bisogna scaricare librerie o si puo fare con quelle giā esistenti ?
Avevo quasi paura della risposta. Ti prego spiegami come cavolo funziona quel sito. Xchč qualunque domanda faccia, qualunque problema abbi, la risposta e su jakarta. Ma quant'č vero iddio fossi stato capace di capirci qualcosa ......
O mio floyd illuminami come il solito.....
preso da una faqcodice:HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("new sheet"); HSSFRow row = null; // Aqua background HSSFCellStyle style = wb.createCellStyle(); style.setFillBackgroundColor(HSSFColor.AQUA.index); style.setFillPattern(HSSFCellStyle.BIG_SPOTS); HSSFCell cell = row.createCell((short) 1); cell.setCellValue("X"); cell.setCellStyle(style); // Orange "foreground", foreground being the fill foreground not the font color. style = wb.createCellStyle(); style.setFillForegroundColor(HSSFColor.ORANGE.index); style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); for (int x = 0; x < 1000; x++) { // Create a row and put some cells in it. Rows are 0 based. row = sheet.createRow((short) k); for (int y = 0; y < 100; y++) { cell = row.createCell((short) k); cell.setCellValue("X"); cell.setCellStyle(style); } } // Write the output to a file FileOutputStream fileOut = new FileOutputStream("workbook.xls"); wb.write(fileOut); fileOut.close();
provalo, poi mi dici