Convert ASCII File into HTML

Hi All,
I have a requirement to convert ASCII files (formatted files when opened through Textpad / Editplus) into HTML when its hyperlink is clicked from my application.
The present code is that, the TXT file was streamed, html tags have been added and the entire file was re-written as HTML (based on char 12 / 32, as the case may be) and saved as JSP / HTML extension, and placed in a temp folder.
response.sendRedirect() was used to open this file, which threw OutofMemoryException errors.
It was also revealed that, if the original ASCII file was 40KB, the converted JSP file would be 160KB (around 4 times)
The ideal conversion should be - add html tags in the new file and maintain the same formatting as the original ASCII file, & save the file with new extension.
Thus I need a memory efficient method such that these files are converted on the fly by the application, yet the size kept minimum.
Please suggest. Thanks in advance
Regards
Hari N

160k is trival on a modern desktop OS. Especially since it is temporary. What heap size is the server using?

Similar Messages

  • Is it possible to convert PDF file into HTML

    Dear friends
    Is it possible to convert PDF file into HTML. I have few hundread PDF files i like to convert this files into HTML. I hope it can be done through Java but i don't know how to start this coding. anybody can give me a brief idea to go ahead.

    Why do you want to do this yourself? I quick search on Google showed several utilities to do this, some freeware, some commercial.

  • I am having problem in Converting .psd file into HTML site.

    here is the screen shot of the PSD which i converted into HTML. It is done with the help of Slice select too. and i got this kind of error in output. so i want a way by which i can transform my psd designs the same way they look in to working website. the template goes other places

    Just wanted to correct something you said, simply because beginners are reading these forums and may get confused.
    You can not convert any image into an html file. An html file is simply a text file that uses tags that can point to an image file.
    Web browsers normally accept jpg, png, and gif files, so you can convert your psd file into one of those three formats and let the html file point to it.
    Here are some sites for learning about html and css. Its the latter that can help with your positioning issue.
    http://www.htmlbasix.com/
    http://www.htmlgoodies.com/
    http://www.thesitewizard.com/
    http://www.lissaexplains.com/
    http://www.w3.org/MarkUp/html-spec/html-spec_toc.html < - - - The Official source
    http://www.yourhtmlsource.com/
    http://msdn2.microsoft.com/en-us/library/aa286532.aspx Microsoft’s info
    w3.org also has the official specs for css.

  • Converting PDF files to html

    I am trying to convert a number of .pdf files into html
    format for a webhelp project unfortunately when I convert them it
    makes several html pages unlike the MS word files which just
    produce one long page.
    I have downloaded a trail version of Adobe Acrobat 8 which
    allows you to convert the files into html but it does not hold the
    formatting of the original document and in one case some of the
    fonts turned white and you could not see the text. (I don’t
    seem to get this when converting MS Word documents)
    Is there anyway that individual html pages can be joined?

    Hi Molaa
    That's normally the way a conversion to HTML format works.
    Normally in the world of HTML, you want your information on several
    smaller "bite size" chunks. I suppose if you honestly want it all
    on a single page, you could perform a copy/paste to put it all
    together after it gets converted to HTML.
    Cheers... Rick

  • Have converted pdf file into a word document. How do I engage the edit option?

    Have converted pdf file into a word document. How do I engage the edit option?
    jnicholasperkins@

    Not stupid you! To, from PDF--it gets confusing!
    To edit a PDF file, you need to use Acrobat. Depending on how much work needs to be done to the PDF, it may make sure sense to edit in Word, and then reconvert to PDF. Acrobat doesn't function as a word processor, so while limited changes to the text should be fine, extensive updates may not yield the results you're looking for.
    That said, if you don't have Acrobat, you are welcome to try it for free for 30 days. For more information, see www.adobe.com/products/acrobat.html.
    Best,
    Sara

  • How to convert csv files into java bean objects?

    Hi,
    I have a CSV file, I want to store the data availabale in that csv file into java bean, I am new to this csv files how can I convert CSV files into java beans.
    Please help me.
    Adavanced Thanks,
    Mahendra

    You can use the java.io API to read (and write) files. Use BufferedReader to read the CSV file line by line. Use String#split() to split each line into an array of parts which were separated by comma (or semicolon). If necessary run some escaping of quotes. Finally collect all parts in a two-dimensional List of Strings or a List of Javabeans.
    java.io API: [http://www.google.com/search?q=java.io+javase+api+site:sun.com]
    java.io tutorial: [http://www.google.com/search?q=java.io+tutorial+site:sun.com]
    Basic CSV parser/formatter example: [http://balusc.blogspot.com/2006/06/parse-csv-upload.html]

  • Convert XML file into PDF file

    <b>XML to PDF</b>i want to Convert XML file into PDF file pl. any one can suggests API's

    Hi,
    There are many ways to convert XML files to PDFs through java.
    One of the easiest way is by using iText.jar which have classes for conversion.
    The following are the required steps
    1. Create a document object for the XML file ( Using DOM or SAX parser).
    2. Parse the xml document and extract the content to write in PDF.
    3.Create a itext Document object.
    4.Get a PdfWriter instance for the PDF file.
    5.Write in the pdf the extracted text using the document object.
    Refer <a href="http://itextdocs.lowagie.com/examples/com/lowagie/examples/general/HelloWorld.java">here</a> for a simple pdf writer example.
    Refer <a href="http://java.sun.com/developer/codesamples/xml.html">here</a> for examples of XML Parsers.
    Regards,
    Uma

  • How do you convert Raw files into jpeg.

      I have never shot in Raw before and I have a huge project due tomorrow. I need help Asap. What is the easiest way to convert Raw files into jpeg, can Light Room convert the files. I have tried so many different ways and nothing seems to work.

    michaelfragale wrote:
      I have never shot in Raw before and I have a huge project due tomorrow. I need help Asap. What is the easiest way to convert Raw files into jpeg
    It depends on the sofware you have.  ACR (Adobe Camera Raw) hosted by Bridge or by Photoshop can convert ("open") raw files, as can Lightroom.
    However, not all camera models are supported by all versions of the software.  We need to know the make and exact model of the camera that generated the raw files to advice you further.
    We can also assist you with the conversion through ACR hosted by Photoshop.
    Olease note that there are dedicated forums for Lightroom, for Adobe Camera Raw and for Bridge.
    Here's the list of which cameras are supported by each version of ACR.  Note that later versions supporte all camera models supported in previous versions of ACR.
    http://kb2.adobe.com/cps/407/kb407111.html
    Note that the latest version of ACR to run in CS4 is ACR 5.3;
    CS3 runs ACR 4.6;
    CS2 runs ACR 3.7;
    CS runs 2.4.

  • How to convert table content into html format?

    Hi,
    Experts,
    How to convert internal data into HTML format is there any function module or piece of code to download content into HTML.
    Thank u,
    Shabeer Ahmed.

    Then use this code....
    REPORT  ytest_table_html1.
    *        D A T A   D E C L A R A T I O N
    *-HTML Table
    DATA:
      t_html TYPE STANDARD TABLE OF w3html WITH HEADER LINE,
                                           " Html Table
    *- Declare Internal table and Fieldcatalog
      it_flight TYPE STANDARD TABLE OF sflight WITH HEADER LINE,
                                           " Flights Details
      it_fcat TYPE lvc_t_fcat WITH HEADER LINE.
                                           " Fieldcatalog
    *-Variables
    DATA:
      v_lines TYPE i,
      v_field(40).
    *-Fieldsymbols
    FIELD-SYMBOLS: <fs> TYPE ANY.
    *        S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
      SELECT *
        FROM sflight
        INTO TABLE it_flight
        UP TO 20 ROWS.
    *        E N D - O F - S E L E C T I O N
    END-OF-SELECTION.
    *-Fill the Column headings and Properties
    * Field catalog is used to populate the Headings and Values of
    * The table cells dynamically
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'SFLIGHT'
        CHANGING
          ct_fieldcat            = it_fcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2.
      DELETE it_fcat WHERE fieldname = 'MANDT'.
      t_html-line = '<html>'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '<thead>'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '<tr>'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '<td><h1>Flights Details</h1></td>'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '</tr>'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '</thead>'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '<table border = "1">'.
      APPEND t_html.
      CLEAR t_html.
      t_html-line = '<tr>'.
      APPEND t_html.
      CLEAR t_html.
    *-Populate HTML columns from Filedcatalog
      LOOP AT it_fcat.
        CONCATENATE '<th bgcolor = "green" fgcolor = "black">'
            it_fcat-scrtext_l
            '</th>' INTO t_html-line.
        APPEND t_html.
        CLEAR t_html.
      ENDLOOP.
      t_html-line = '</tr>'.
      APPEND t_html.
      CLEAR t_html.
      DESCRIBE TABLE it_fcat LINES v_lines.
    *-Populate HTML table from Internal table data
      LOOP AT it_flight.
        t_html-line = '<tr>'.
        APPEND t_html.
        CLEAR t_html.
    *-Populate entire row of HTML table Dynamically
    *-With the Help of Fieldcatalog.
        DO v_lines TIMES.
          READ TABLE it_fcat INDEX sy-index.
          CONCATENATE 'IT_FLIGHT-' it_fcat-fieldname INTO v_field.
          ASSIGN (v_field) TO <fs>.
          t_html-line = '<td>'.
          APPEND t_html.
          CLEAR t_html.
          t_html-line = <fs>.
          APPEND t_html.
          CLEAR t_html.
          t_html-line = '</td>'.
          APPEND t_html.
          CLEAR t_html.
          CLEAR v_field.
          UNASSIGN <fs>.
        ENDDO.
        t_html-line = '</tr>'.
        APPEND t_html.
        CLEAR t_html.
      ENDLOOP.
      t_html-line = '</table>'.
      APPEND t_html.
      CLEAR t_html.
    *-Download  the HTML into frontend
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'C:\Flights.htm'
        TABLES
          data_tab                = t_html
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *-Display the HTML file
      CALL METHOD cl_gui_frontend_services=>execute
        EXPORTING
          document               = 'C:\Flights.htm'
          operation              = 'OPEN'
        EXCEPTIONS
          cntl_error             = 1
          error_no_gui           = 2
          bad_parameter          = 3
          file_not_found         = 4
          path_not_found         = 5
          file_extension_unknown = 6
          error_execute_failed   = 7
          synchronous_failed     = 8
          not_supported_by_gui   = 9
          OTHERS                 = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    none of the above function modules r obsolete...

  • I have a mac ox 10.5.8 and I'm trying to download a downloader that converts video files into mp3 but none of them wont open. Can anyone help?

    I have a mac ox 10.5.8 and I'm trying to download a downloader that converts video files into mp3 but none of them wont open. Can anyone help?

    http://software-download.name/video-to-mp3-converter-osx/
    http://www.macworld.com/article/1161412/how_to_convert_audio_and_video_files_for _free.html
    http://www.applemacvideo.com/howtoconvert/flvmac/flv-to-mp3-mac.html
    http://www.iskysoft.com/convert-audio/convert-mpeg1-to-mp3-mac.html
    Not sure if any are PPC, oR 10.5.8 compliant, still, if you give a link to one you're trying, it may be helpful.

  • How to convert .doc file into .rtf file in Java?

    Hello All,
    I want to convert doc file into rtf format in java and for the same i am not getting any help so pls suggest some solution for that.
    Thanks and Regards
    only1Vinay

    MS-Word formats (DOC) are notorious for not being standardized from one version to another, so what ever you get will be version specific. If you must do the conversion, I suggest you do a MS-Script in Word to do it or one of the .Net languages. As stated the Word format from version to version is not standardized.

  • Acrobat XI Pro successfully installed, but it failed in converting word files into PDF, why?

    I just installed Adobe XI Pro through the download assistant, it looks the installation went well, but when I tried to convert word files into PDF (tried many times), it failed. Anyone has the same problems, any solutions?

    Please reply with more information - what your operating system is, do you have Office installed, and what exactly is happening. Is there an error message, does the application crash, and from where are you starting the conversion (using Word and PDFMaker, using Acrobat's Create button, or batch processing).

  • How to convert jpeg files into word

    How to convert jpeg files into Word

    Hi Eugene,
    I don't think you can convert an image to a Word document, but you could place the JPEG into a Word document using the Insert > Object command in Word.
    For other questions relating to Word, you will probably have more luck getting an answer if you post on the Microsoft forums (we can help if you're using Acrobat, or another Adobe product, but you'll find the Word experts on the Microsoft forums.)
    Best,
    Sara

  • I can't Convert midi files into any other format

    A few months ago, I was able to convert midi files into mp3 when one day, I updated iTunes using software update. Ever since the updates I had for my Mac it still hasn't work.
    It has this error that won't allow me to convert. I talked to my friend wrldwzrd89 who is one of my friends and he said that it is because Apple had a piece of data missing allowing midis to be converted to mp3, or any other format.
    Is this true or do you know the solution?

    I can't tell you the exact reason why it doesn't work, but there is an article about this problem and a solution if you have QuickTime Pro:
    iTunes: MIDI files cannot be converted in iTunes 6.0.3 and 6.0.4
    Not the last sentence in the article. That usually means they're working on a fix.
    No guarantee that it will be fixed in the next version however. We'll have to wait and see.
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.4.6)   Several ext. HD (backup and data)

  • How to convert Doc file into image

    hello frnds
                     Can any body guide me how to convert doc file into image and show into swf loader.
    actually i have to convert doc files into swf files in runtime so that i have to use this flow.
    is it possible to convert doc file into byte array and than convert into image.
    Thanks And Regards
        Vineet Osho

    You can convert any DisplayObject to byeArray using this function ImageSnapshot.captureBitmapData().getPixels()

Maybe you are looking for

  • Custom Warning/Error status on Packages

    Hi All, I'm running a custom Stored Procedure which is then linked to a *RUN_STORED_PROCEDURE command in a logic in BPC7 (Microsoft version, SP7). I would like to control the package status from within the stored procedure. After some tests, I've lea

  • How to get count of member

    hi  i have 2 table like this table1 memberid     name   1                    roy 2                    cartrie table2 memberid            name               location 1                        roy                             nj 1                        

  • DISAPPEARING FLASH MOVIES, ONLY SOUND

    To all the people who kindly help everyone else with their problems(not Adobe!!!) Im having this problem for some time now and I have posted it before in the past but no replies were given. I assume people are lazy rather than they dont have any solu

  • Trying to generate a honeycomb grid

    Hi all: What is the easiest way to generate a honeycomb grid? Something like this: http://static-p4.fotolia.com/jpg/00/09/26/31/400_F_9263157_xdd2OEV9eO3OwbJtKAvfYyCjDHs53Ys r.jpg

  • Coloring of selected table cells: Ideas wanted

    Hi there, for a WD ABAP component to be re-used in various scenarios my customer seek the most comfortable and fency way to color table cells which have been selected first. I am almost sure that there is no UI Control in ABAP WD which allows the sel