Foros del Web » Programación para mayores de 30 ;) » Java »

PrintWriter

Estas en el tema de PrintWriter en el foro de Java en Foros del Web. Hola, tengo un problemilla que no encuentro solución... He implementado un método el cual escribe en un archivo 'inputTxtFile' un determinado texo. (parte del código ...
  #1 (permalink)  
Antiguo 12/02/2010, 04:56
 
Fecha de Ingreso: octubre-2007
Mensajes: 5
Antigüedad: 16 años, 7 meses
Puntos: 0
Exclamación PrintWriter

Hola, tengo un problemilla que no encuentro solución...

He implementado un método el cual escribe en un archivo 'inputTxtFile' un determinado texo. (parte del código lo pongo a continuación)

Mi pregunta es, hay un máximo de líneas que se puedan escribir en un archivo utilizando PrintWriter??????????
Cuando ejecuto este código con la mitad de las líneas htmlPrintWriter.println("...") que necesito se ejecuta correctamente, pero cuando lo pongo todo no...

Alguien puede ayudarme????????????????

Cita:
public void copiaTextoEnArchivo(String inputTxtFile){
String s;
try{
File txtFile = new File(inputTxtFile);
File htmlFile = new File(inputTxtFile);//+".html");
FileReader txtFileReader = new FileReader(txtFile);
BufferedReader txtBuffReader = new BufferedReader(txtFileReader);
PrintWriter htmlPrintWriter = new PrintWriter(htmlFile);


htmlPrintWriter.println("<html xmlns='http://www.w3.org/1999/xhtml'>");
htmlPrintWriter.println("<head>");
.......................
.......................
.......................
htmlPrintWriter.println(" </head>");
htmlPrintWriter.println(" <body onload='initialize()' onunload='GUnload()' bgcolor='#6699FF'>");
htmlPrintWriter.println(" <div id='map_canvas' style= 'width:750px; height:600px'> </div>");
htmlPrintWriter.println(" </body>");
htmlPrintWriter.println("</html>");
//Start reading file line by line and write into the html file
while((s=txtBuffReader.readLine())!=null)
{
htmlPrintWriter.println("<h1>"+s);
//htmlPrintWriter.println("<br>");
}
htmlPrintWriter.close();
txtBuffReader.close();
}catch(Exception e){
e.printStackTrace();
}
}

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:42.