This discussion is archived
9 Replies Latest reply: May 26, 2008 1:16 AM by 807591 RSS

Writing HTML data in TEXT File

807591 Newbie
Currently Being Moderated
I am writing HTML content in TEXT file ...I read it in a string and then write using PrintStream...

But it writes all content on one line ..I want to write it as it was in source HTML file...
  • 1. Re: Writing HTML data in TEXT File
    DarrylBurke Guru Moderator
    Currently Being Moderated
    A commendable ambition.

    Now, do you have a question?
    [http://catb.org/~esr/faqs/smart-questions.html]

    db
  • 2. Re: Writing HTML data in TEXT File
    807591 Newbie
    Currently Being Moderated
    What is this??????????
  • 3. Re: Writing HTML data in TEXT File
    DarrylBurke Guru Moderator
    Currently Being Moderated
    An inane question, followed by 9 extra question marks.
  • 4. Re: Writing HTML data in TEXT File
    807591 Newbie
    Currently Being Moderated
    I Think its v simple...however I explain it for u..

    I am reading an HTML file ........I will read data from this HTML file in a string variable and then I want to write it back to a text file.....When I write the data in text file using PrintStream, It writes all data in one line ...i.e. like this <html> <head> <title> ..............................................</head></html>

    But I want that it should be written like it was in its source HTML file i.e.
    <html>
    <head>
    <title>
    ............
    
    ...........
    
    </head>
    </html>
    I hope its ok for u now
  • 5. Re: Writing HTML data in TEXT File
    DarrylBurke Guru Moderator
    Currently Being Moderated
    In addition to the link already provided at response #1:
    [How To Get Good Answers To Your Questions|http://www.tek-tips.com/viewthread.cfm?qid=473997]
    [http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch]

    Of course, if you don't really want help, don't bother to read them.

    db
  • 6. Re: Writing HTML data in TEXT File
    807591 Newbie
    Currently Being Moderated
    Are you mad or what????

    Don't reflect the problems with your wife or girl friend on this forum .............

    keep your nerves cool or keep yourself away from computer when you have such kind of problem...

    I have clarified the question .......................but you .............
  • 7. Re: Writing HTML data in TEXT File
    DarrylBurke Guru Moderator
    Currently Being Moderated
    Ah well. Three good links and you can't take the trouble to read up on how to ask a good question.

    Apart from the SMSese in the earlier post and the profusion of periods in the last, your question is not only not good, it is not answerable as you haven't posted any relevant details, only a problem description.

    And slanging someone doesn't increase your chances of getting help here. If you must troll, at least try to be original and add some entertainment value. The tired old cliches you posted are just boring.

    db
  • 8. Re: Writing HTML data in TEXT File
    794117 Explorer
    Currently Being Moderated
    Perchance, the OP is referring to the lack of carriage returns in his outputted data, and querying where they have absconded to? An analysis of his posts to date reveals that he has read the contents of a File into a String variable, and wants to write the (presumably modified) String back to a file (uncertain as to whether this is the same file or a different one) In the process of outputting to said file, carriage returns previously contained in the original input file are not present in the output. I would hazard a guess that the OP does not want said carriage returns in the String to disappear.

    Is my analysis of the situation correct?
    An example of the code that you have written to date would be of extreme usefulness to us in aiding you in your noble quest.
    Without such a resource, I must rely on my intuition instead.

    Possible places that the carriage returns are being "dropped"
    1 - On reading in. Are you discarding carriage returns while building up your variable?
    2 - On manipulating. Are you processing this line by line, or reading it all into one large variable?
    3 - On output - are you using "print" or "println" in the output?

    I look forward to further correspondence with you sir
    kind regards,
    evnafets
  • 9. Re: Writing HTML data in TEXT File
    807591 Newbie
    Currently Being Moderated
    Thanks a lot @ evnafets............

    I am sorry on my part for any inconvenience but you guessed well and I got it solved from three clues you gave in your reply.

    Thanks again............