Connecting two programs - please help

Hi, I'm new here, so I'd like to say 'hi' to everyone :) I'm a freshman in the java comunity, so please be gentle.
Firs of all I'd like to ask how to resolve the first problem. I've got the code which is responsible for convert a html document to the txt file. It looks like:
import javax.swing.text.html.parser.*;
import javax.swing.text.html.*;
import javax.swing.text.*;
import javax.swing.*;
import java.io.*;
public class TextFromHtml extends HTMLEditorKit.ParserCallback{
static String trimmss(String o){
   return (o.trim()).replaceAll("\\s+", " ");
public void handleText(char[] data, int pos){
try{
      String o = new String(data);
      PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.txt", true)));
      o = trimmss(o);
      pw.println(o);
      //pw.close();
     catch (IOException exc){}      
System.out.println(new String(data));
  public static void main(String args[]){
    try{
      String s = JOptionPane.showInputDialog("Enter the name of the file you want to convert from html to txt.");     
      Reader r = new FileReader(s);
      ParserDelegator parser = new ParserDelegator();
      HTMLEditorKit.ParserCallback callback = new TextFromHtml();
      parser.parse(r, callback, true); 
    catch (IOException e){
      e.printStackTrace();
     System.exit(0);
}But unfortunately I don't know how to change this code to obtain such situation as making a new txt file without blank spaces > 0 and erasing the \n new lines. I'd like to get a txt file, which contains of line-by-line text. Could you please help me - tell & show me how to do that? I'd be very grateful
Regards, skullscape.

Hi Skullscape,
My apologies for not getting a response on this forum, but this may have been because this is a fairly generic Java programming question, rather than an issue specific to the JSE product, the purpose of this particular forum.
So may I suggest that you check out http://java.sun.com/ which has a full set of facilities for those such as yourself who are new to Java programming.
Although by now you nay not be such a novice :-)

Similar Messages

Maybe you are looking for

  • Using two computers with one Extigy sound c

    Hello: This is my first post; am wondering if there is a way to plug the Extigy USB input into two computers at the same time, perhaps with a USB sharing device? Has anyone ever tried this? Thanks. Glad to be part of the new community group. Pineocea

  • How can I map half the keyboard to another instrument

    Hey, Let's say that I want the left half of my M-Audio keyboard to play a Chruch Choir and the right half to play Piano, how should I proceed? Thanks,

  • BDC : creating Billing frm Dr/Cr Memo - Problem in deletion of  conditions

    Dear Gurus, I am facing a problem when I try to develop a BDC for creating a Billing document from a Debit/Credit Memo Sales Order. The requirement is to delete some condition when creating billing from debit note for Depot plant. The problem I am fa

  • Error -200279

    Hi friends, I am getting the error -200279 during acquisition. I have developed the application in a PXI located at my place. The application is running fine in that PXI. But when I ran it on PXI which is located at a remote site. It is giving this e

  • Trouble opening Illustartor CC

    I just signed up for Illustrator CC trial version but can't figure out how to open the application on my PC. Can you point me in the rtight direction? Thanks