Reading ams word doc and creating another ms word doc with this same data

I have a ms word doc and i hav to create different word docs from it with different name.The docs will contain the same data as the mother document but some cases,some strings will be replaced by some new strings for each document to be created.plz help me out.
File ReadDocFileInput = new File(inFilePath + "APX-DBEST.DOC");
BufferedReader readXML = new BufferedReader(new InputStreamReader(new FileInputStream(outFile)));
          String FirstTag = null;
          String writeIntoDoc = null;
          String writeTagName = null;
          String writeTagSTEPName = null;
          File WriteDocFileOutput = new File(inFilePath + "APX-DBEST-" + writeTagName + ".RTF");
          BufferedReader fis = new BufferedReader(new InputStreamReader(
                    new FileInputStream(ReadDocFileInput)));
          //FileInputStream fis = new FileInputStream(ReadDocFileInput);
          //FileOutputStream fos = new FileOutputStream(WriteDocFileOutput);
          PrintWriter fos = new PrintWriter(new FileOutputStream(WriteDocFileOutput) );
          //int i =0;
          //char ch;
          while((writeIntoDoc = fis.readLine())!=null){
               //ch = (char)i;
               fos.write(writeIntoDoc);
          fis.close();
          fos.close();
          //WriteDocFileOutput.renameTo(new File(inFilePath + "APX-DBEST-" + writeTagName + ".DOC"));
this is the code i hav written...anything wrong in it?...it does not working.

I didn't read your code. But if you want to copy a file, commons has a neat tool for it:
import org.apache.commons.io.IOUtils;
import java.io.*;
class CommonsFileCopy {
    public static void main(String[] args) {
        String fIn = "CommonsFileCopy.java";
        String fOut = "(copy) CommonsFileCopy.java";
        try {
            InputStream inStream = new BufferedInputStream(new FileInputStream(fIn));
            OutputStream outStream = new FileOutputStream(new File(fOut));
            IOUtils.copy(inStream, outStream);
            System.out.println("Copied \""+fIn+"\" to \""+fOut+"\" successful");
        catch(IOException ioe) { ioe.printStackTrace(); }
}

Similar Messages

  • I wrote an 2500 words assignment and saved in Microsoft word 97-2003 and by mistake replaced with another word file.How can i retain my original work?

    I wrote an 2500 words assignment and saved in Microsoft word 97-2003 and by mistake replaced with another word file.How can i retain my original work? 

    Hi,
    Does this happen to all 97-2003 Word files?
    Word 2013 now has lots of updates compared with earlier version of Word, lots of features have been updated. Use Word 2013 to open documents created in earlier versions of Word (Word 97-2003 format), you will probably encounter unexpected problems,
    expecially for those heavily formatted files.
    We would suggest you to convert your document to the Word 2013 file format, then you will be able to access the new and enhanced features in Word 2013.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • I am looking for an application that would allow me to open a word doc, and take notes in the .doc using a stylus pen.  I'd then like to convert those notes to text, and then be able to copy / paste those notes into an email.  Does this app exist?

    I am looking for an application that would allow me to open a word doc, and take notes in the .doc using a stylus pen.  I'd then like to convert those notes to text, and then be able to copy / paste those notes into an email.  Does this app exist?  It seems like we were doing these same types of things with Palm Pilots years ago, one would think this would work with iPads?

    I don't believe it will open a Word document, but Writepad allows for handwritten conversion of notes to text and then to email. Might help you some of the way...

  • How to add a "Create and Create Another" button to form

    I have an input form on a table with several LOV select lists and a text field. To ease data entry, the user wants to create several records, one at a time, by remaining on the same form page. Built-in APEX functionality adds the record and returns the user to the report page.
    User wants to create the first record by clicking the Create button, stay on the form with all the LOV values as they were (not clearing cache), change one or two LOV choices and the text field, and click a "Create and Create Another" button. The user will stay on the form until clicking the "Cancel" button.
    I changed the branch on the form to call itself. The LOV and text field values remain, but the "Create" button disappears to add another. Of course, I'll need to run the Get PK process to get the next sequence number for the new record.
    Looking for the best way to accomplish this. Thanks!

    If it is using the default setup, I believe you would clear the PK field (and now others) on branch to same for "Create and Create Another", as that is the default criteria for whether the Create button is shown.

  • I have an account that the email address live, but they stole my account and changed direccionn email to Gmail but now that I have new email in gmail not in me finds the account or reconose me the key and create another account, but the Musia that havi bo

    had a live email account, but the account was stolen and opened an email account in gmail and made the change by hour account but I do not recognize this and create another account with the same email, but in the other account had purchased music, as I can do to recover purchased music.
    The previous Cunta I have it open on a pc but the pc is not mine

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact Apple ID Support, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
    The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
    Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
    Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
    Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do.

  • I have entered my gmail id as my apple id, and created another icloud id. Now my mailbox shows No mail. Is this mailbox shows icloud mailbox or my gmail mailbox? How do i open my gmail mailbox in my iphone? or simply will have to download a gmail app?

    I have entered my gmail id as my apple id, and created another icloud id. Now my mailbox shows No mail. Is this mailbox shows icloud mailbox or my gmail mailbox? How do i open my gmail mailbox in my iphone? or simply will have to download a gmail app?

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")

  • How can I delete my apple id and create another one with the same email?

    How can I delete my apple id and create another one with the same email?

    So sorry; somehow I forgot to provide the link.   Here it is ...
    Frequently asked questions about Apple ID
    Again, my apologies.

  • What is the best, most efficient way to read a .xls File and create a pipe-delimited .csv File?

    What is the best and most efficient way to read a .xls File and create a pipe-delimited .csv File?
    Thanks in advance for your review and am hopeful for a reply.
    ITBobbyP85

    You should have no trouble doing this in SSIS. Simply add a data flow with connection managers to an existing .xls file (excel connection manager) and a new .csv file (flat file). Add a source to the xls and destination to the csv, and set the destination
    csv parameter "delay validation" to true. Use an expression to define the name of the new .csv file.
    In the flat file connection manager, set the column delimiter to the pipe character.

  • After I reinstall Itunes, the message read "the file iTunes Library.it cannot be read because it was created by a newer version of itunes, i have tried with iTunes version 11.1, 10.1 and 9.1 still come up with the same message and will not open iTunes

    after I reinstall Itunes, the message read "the file iTunes Library.it cannot be read because it was created by a newer version of itunes, i have tried with iTunes version 11.1, 10.1 and 9.1 still come up with the same message and will not open iTunes

    Try the following user tip:
    Empty/corrupt iTunes library after upgrade/crash

  • How to cancle the previous apple ID and creat another one for the same ipad mini

    Please advise how to cancle the previous apple ID and creat another one for the same ipad mini.
    Thank you.

    You can log out of an account (you can't 'cancel' an account) by tapping on it in Settings > iTunes & App Store - any content that you downloaded with that account will remain tied to that account. You can then create a new account via the Create New Apple ID button on that screen. If you don't want to give credit card details then follow the instructions on this page when creating the new account : http://support.apple.com/kb/HT2534

  • After upgrading my 3gs to ios5, I get 2 copies of pictures synced from my computer, 1 in the Photo Library and another in a library with the same name as the folder I put the pictures in to put on the phone. Any ideas why?

       When syncing pictures from my computer to my I-Phone I get 2 copies of the pictures, 1 in the Photo Library and another in a library with the same name as the folder I put pictures in to put on the phone. This started after I upgraded to ios5. I have tried re-installing I-Tunes. I have not reset the phone. My main concern is the amount of memory pictures take up on the phone. It's not a problem now but could be in the future. Any Ideas on why this happening?

    It has always been this way.  it was never different.  This is how the iphone handles photos - always has.
    There are NOT two copies,  There are simply two ways to access the very same photos.  All synced photos will ALWAYS be under Photo Library ( you can look at all photos at once this way or do a slideshow of all photos).  Those very same photos can also be accessed from the individual folders so you can show or slideshow just that folder.
    Just as a book can be in the library and in the fiction section, there is only one book/photo.

  • Hi... I would like to purchase a Tablet Sony Xperia Z 2 10.1 (the last one of the Z series) and I was told that Adobe does not support Sony anymore.... I need to be able to open and read Adobe PDF files and I would like to know if this tablet can still us

    Hi... I would like to purchase a Tablet Sony Xperia Z 2 10.1 (the last one of the Z series) and I was told that Adobe does not support Sony anymore.... I need to be able to open and read Adobe PDF files and I would like to know if this tablet can still use Flash Player...
    Is there anyo who can help me with this? I asked in the shop and I was told "yes of course" , but when I contacted Sony directly I was advised to check with Adobe as apparently in the recent months Adobe and Sony haven't been getting along anymore...

    You may be mixing up two entirely different Adobe products.
    1. Adobe Flash Player. Needed to view web pages designed with Flash. Not needed to view PDF files. Not available for Android (not just Sony).
    2. Adobe Reader. Reads PDF files. However, the Android can also read most PDF files without needing Adobe Reader.

  • I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID and  accound now my husband can see all the text I send and I get everything he gets how could I get his phone out of my accound

    I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID and  accound now my husband can see all the text I send and I get everything he gets how could I get his phone out of my accound

    Mishijos3 wrote:
    I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID ...
    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • Create a listing of reports with last run date and # of times run

    Hi All,
    I want to create a listing of reports with last run date and number of times report is run in the past 18 months.
    If anybody can please help me with the query for the same.
    Regards,
    Sk
    Edited by: user10989244 on Aug 18, 2009 7:12 AM

    Hi Sk
    Assuming you have the collection of statistics enabled, which it is out of the box, you can get the information you need from the EUL5_QPP_STATS table. This script will help:
    SELECT
    QPP.QS_DOC_OWNER WORKBOOK_OWNER,
    QPP.QS_DOC_NAME WORKBOOK_NAME,
    QPP.QS_DOC_DETAILS WORKSHEET_NAME,
    QPP.QS_CREATED_BY RUN_BY,
    TRUNC(MAX(QPP.QS_CREATED_DATE)) LAST_USED_DATE,
    COUNT(QPP.QS_ID) TIMES_USED
    FROM
    EUL5_QPP_STATS QPP
    WHERE
    QPP.QS_CREATED_DATE >= ADD_MONTHS(SYSDATE, -18)
    GROUP BY
    QPP.QS_DOC_OWNER,
    QPP.QS_DOC_NAME,
    QPP.QS_CREATED_BY,
    QPP.QS_DOC_DETAILS
    ORDER BY 1,2,3;
    Best wishes
    Michael

  • An attempt to install Adobe reader X on my Mac OS 10.5.8 failed, with this message: "Run preinstall script for application." What is that, and how do I do it?

    An attempt to install Adobe reader X on my Mac OS 10.5.8 failed, with this message: "Run preinstall script for application." What is that, and how do I do it?

    Hi renmusn79002737,
    Could you please try installing Reader again from the below mentioned link:
    http://get.adobe.com/reader
    Ensure that you are logged in as administrator and anti-virus is disabled as that might interrupt downloading.
    Try again and then let me know.
    Regards,
    Anubha

Maybe you are looking for

  • I can't sign in

    I can't sign in to ExportPDF from inside Reader X. I also can't find the phone number for customer support

  • Input Help in BSP application

    Hi, I need to associate standard and custom input helps to a custom field in the standard BSP of Opportunity in the Details tab. I don't know nothing about this so where can I find some documentation? I want to understand the meaning of: Field Name -

  • Storage Issue- MacBook Air 64GB

    Is it possible to upgrade an 11" MacBook Air 64GB to 128GB SSD?

  • Best practice steps for Hyper-V virtual server

    Hello, I need help in below questions. Please help. Q1) What are the best practice steps to create a VM with Hyper-V? Q2) What is the best practice for virtual network cluster? Q3) What are the domain controllers? and how to upgrade it from 2003 doma

  • How do I get updates for Photoshop Elements 11 for Mac?

    How do I get updates for Photoshop Elements 11 for Mac?