How to copy the content of one file into another

I have tried this code
try {
               fin = new FileInputStream("file path");
          catch(FileNotFoundException exc)
               System.out.println("File not found");
               return 0;
          catch(ArrayIndexOutOfBoundsException exc)
               System.out.println("Usage: Showfile file");
               return 0;
          while(true){
               i=fin.read();
               if(i==-1)
                    break;
               cnt++;
          fin.close();*/
now in this way i can lift one character at a time and copy it into another file (note i have not done the copy part in this code but that can be implemented) however this whole procedure is taking too much time if the size of the file is too big....kindly suggest another way to copy one file into another

have you ever copied and pasted a large file in Windows or another OS? Larger files take more time to copy, that's just how it is.

Similar Messages

  • How to save the contents of one file into another file?

    Hai,
    i'm trying to save the contents of an existing file into a new file...
    for example.. if i'm having a ms word file namely ss.doc..
    now i want to save itz contents into another file namele dd.doc..
    How shall i do it..
    Can an one plzz explain me...
    senthil.

    Hi, Senthil.
    This Forum is not a general discussion forum.
    You don't believe that the InDesign SDK is a general purpose API. Do you?
    I think you must post issues like this where they belong, in this case in a Microsoft Word Forum.
    Best regards.
    Oscar.

  • How to copy the data from one database to another database without DB link

    Good Day,
    I want to copy the data from one database to another database with out DB link but the structure is same in both.
    Thanks
    Nihar

    You could use SQL*Plus' COPY command
    http://technology.amis.nl/blog/432/little-gold-nugget-sqlplus-copy-command
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/apb.htm#sthref3702
    Edited by: Alex Nuijten on Sep 16, 2009 8:13 AM

  • How to Copy the PLD from one database to another

    Dear Members,
       i have designed the  PLD for Purchase Order, i want to copy the particular PLD into another Database.
    i tried to copy the PLD from one database to another through copy express.. i copied the PLD sucessfully. But the problem is,it copies all PLD's from one database to another. i want only the Purchaseorder PLD has to be copied in to another database.any body can help me in this regard.
    With Regards,
    G.shankar Ganesh

    Hi,
    select * into A1 from RDOC where Author !='System'
    select *  into A2  from  RITM   where Doccode  in (select Doccode from A1 )
    select * from A1
    select * from A2
    sp_generate_inserts 'A1'
    sp_generate_inserts 'A2'
    you will get Insert scripts of A1 and A2 tables .After that You 'll  Replace A1 to RDOC and A2 to RITM.
    So that you can RUN this SQL srcipts any where (In any Database)
    but First u have to run sp_generate_inserts  Storeprocedure(from websites) .
    drop table A1,A2

  • How to Display the content of Excel file into Webdynpro Table

    Hi Experts
    I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
    Thanks and Regards
    Kalyan

    HI,
    Take for example, if Excel file contains 4 fields,
    Add jxl.jar to JavaBuild path and Use this snippet
    File f=new File("sample.xls");
    Workbook w=Workbook.getWorkbook(f);
    Sheet sh=w.getSheet(0);
    int cols=sh.getColumns();
    int rows=sh.getRows();
    Cell c=null;
    String s1=null;
    String s2=null;
    String s3=null;
    String s4=null;
    ArrayList al=new ArrayList();
    int j=0;
    for(int i=1;i<rows;i++)
    ITableElement table=wdContext.createTableElementz
         s1=sh.getCell(0,i).getContents();
         s2=sh.getCell(1,i).getContents();
         s3=sh.getCell(2,i).getContents();
         s4=sh.getCell(3,i).getContents();
                             table.setName(s1);
         table.setAddress(s2);
         table.setDesignation(s3);
         table.setDummy(s4);
         al.add(j,table);
         j++;                    
    wdContext.nodeTable().bind(al);
    Regards
    LakshmiNarayana

  • How to copy the data of one node to another of the same context

    hi experts,
          i need to copy the data of one node to the other node of the same context.
    the source node is a model node ( i.e comming from <b>RFC</b> ) and the destination node is a value node which i have creted.
    what i have done is.
    i have read the source node using wizard
    do.
    elem_t_p0591 = node_t_p0591->get_element(
        index = sy-index ).
        IF ( elem_t_p0591 IS INITIAL ).
          EXIT.
        ENDIF.
    elem_t_p0591->get_static_attributes(
          IMPORTING
            static_attributes = stru_t_p0591 ).
    IF stru_t_p0591 IS NOT INITIAL.
          wa_p0591 = stru_t_p0591.
          APPEND wa_p0591 TO itab_p0591.
        ENDIF.
      ENDDO.
    and then i am trying to read the destination node so the tha data i have got by above method can be binded to the destination node.
    but when i am trying to get the child node it is giving me a dump saying that
    <b>'Access via 'NULL' object reference not possible' </b> i understand this because when i debug my value node is becoming <b>initial</b>, and when i am trying to access the destination node using this <b>initial</b> node it will give me a dump,
    but what is the work aroud for this.
    Plz help.
    Regards,
    Santosh.

    Hi Santosh,
                   I tried replicating your behaviour in my system. This is what my context structure looks like:
    Node_Test (c-> 0:n)
      Name(attribute)
      Node_Test2 (c-> 0:1)
         Name2(attribute)
    Now when i try to access Node_Test2 then it returns me (initial) i.e. no reference and i believe the reason is that my parent node, Node_Test, is of type table( because of the cardinality) so I am expected to perform an operation on my sub node, Node_Test2, based on the node i have selected, or have specified via index .. 1 is taken by default, in Node_Test.. which in WDDOINIT is initial as i havent got access to my view yet.. so instead what you can do is bind data to your parent node, relevant data ofcourse, and then bind the recieved data to your child node i.e. Node3.
    I am pasting the code here for your reference :
    method WDDOINIT .
           DATA:
             node_test                           TYPE REF TO if_wd_context_node,
             elem_test                           TYPE REF TO if_wd_context_element,
             stru_test                           TYPE wd_this->element_test ,
             lt_table   LIKE TABLE OF stru_test,
             item_test_1                         LIKE stru_test-test_1.
         navigate from <CONTEXT> to <TEST> via lead selection
           node_test = wd_context->get_child_node( name = wd_this->wdctx_test ).
         @TODO handle not set lead selection
           IF ( node_test IS INITIAL ).
           ENDIF.
         get element via lead selection
           elem_test = node_test->get_element(  ).
         @TODO handle not set lead selection
           IF ( elem_test IS INITIAL ).
           ENDIF.
    stru_test-test_1 = 'Anoop'.
    APPEND stru_test to lt_table.
    stru_test-test_1 = 'Avi'.
    APPEND stru_test to lt_table.
    stru_test-test_1 = 'Sid'.
    APPEND stru_test to lt_table.
    CALL METHOD node_test->bind_table
      EXPORTING
        new_items            = lt_table
       set_initial_elements = ABAP_TRUE
       index                =
          DATA:
            node_t2                             TYPE REF TO if_wd_context_node,
            elem_t2                             TYPE REF TO if_wd_context_element,
            stru_t2                             TYPE wd_this->element_t2 ,
            item_t2_1                           LIKE stru_t2-t2_1.
        navigate from <CONTEXT> to <TEST> via lead selection
         node_test = wd_context->get_child_node( name = wd_this->wdctx_test ).
        @TODO handle not set lead selection
          IF ( node_test IS INITIAL ).
          ENDIF.
    <b>*     navigate from <TEST> to <T2> via lead selection
          node_t2 = node_test->get_child_node( name = wd_this->wdctx_t2 ).</b>
    <b>*     alternative navigation via index
         Node_T2 = Node_Test->get_Child_Node(
           Name = `T2` Index = 1 ).</b>
        @TODO handle non existant child
        if ( Node_T2 is initial ).
        endif.
        get element via lead selection
          elem_t2 = node_t2->get_element(  ).
        get single attribute
          elem_t2->get_attribute(
            EXPORTING
              name =  `T2_1`
            IMPORTING
              value = item_t2_1 ).
    endmethod.
    I hope this helps.
    Regards,
    Anoop

  • How do I move or copy the contents of one tag to another ?

    No-one was able to answer my question about how I can input data into the Description tag for several tracks at once (Description not being a field listed in the Multiple Item Info window).
    So, thinking along different lines ... Comment IS a tag that is shown but I'm already using it. What I would like to do therefore is to move all the data from Comment to Description (in one go), then I can start using Comment for new data via the Multiple Item Information dialogue.
    How do I move this data from one tag to another? Is there, for example, a Doug Script to do it that anyone knows of?

    No-one was able to answer my question about how I can input data into the Description tag for several tracks at once
    -> Enter Description Text for Selected v1.1
    "This script will apply user-entered text to the "Description" tag of each of the selected tracks."
    How do I move this data from one tag to another?
    Can't find a script to do this.
    However, you can add to the Comments field and leave what is there.

  • How do I move content from one file to another ?

    Hi,
    I have two separate DVD Studio Pro files that I created a while back (single-sided DVD).
    Now I want to put them both on a dual layer DVD. However, I can't figure out for the life of me how to copy content between files. I don't want to "recreate" one of the DVDs from scratch.
    How do I move the menus, tracks, stories, etc from one DVD Studio Pro file to another ?
    Thanks,
    Damon

    You do not need to move the media into the new project assuming all the media is available and on the same hard drive. Usually I keep all DVD SP projects and media on an external drive so it is easy-ish to do. Of course if you copy the assets into the folder for a project it makes thingss easier to move around to other drives. In other words I will create a Poject folder called "MYPROJECT" and in there I will placefolders "MYPROJECTM2Vs", "MYPROJECTAC3S", "MYPROJECTGRAPHICS" etc so if I have to move projects to other computers easier to re-link. Takes up a bit more room if you use the same asset in more than one project but with the costs of Drives so low right now it is worth the lkess hassle to me...
    What is the error you are getting?

  • How to Copy Chapter Markers from one file to another

    Hi all,
    I am a relatively new GB user, so forgive the hopefully easy question. I want to combine four GarageBand files into one, in order. So right now i have part 1, part 2, part 3, etc.
    I figured out how to copy and paste the actual recordings in sequence (selected them all, copy and paste, worked great.) But I also have chapter markers that I want to copy and paste. I have the spacing worked out PERFECTLY and don't want to re-create them all. I know that I can select all the markers in a file, but they don't seem to want to paste. Instead, the headings from the file that were already there seem to repeat (most likely because of the time headings...)
    Is there an easy way to do this?
    - Many thanks,
    Michael

    Hmm. This is a stumper.
    I don't think it's possible in GB, obviously.
    The only thing I can think of off the top of my head is to (from GB) export each project as it's own podcast quicktime movie, then use another app to stitch these movies together? I would think QuickTime Player Pro would do this.
    I tried looking for the chapter markers within the quicktime movie file, hoping you could copy and paste just those, but I didn't find any access to them.

  • How do I merge the content of one website into another with Business Catalyst?

    I have two websites, each of them are Business Catalyst websites.
    I would like to merge website 1 with website 2, so they are on the same domain.
    Each website will effectively be put into it's own directory on the same domain, with the homepage allowing a visitor to decide which website they would like to see.
    Is there an easy way to do this? I have a feeling it's a matter of copying all the content across, modifying the templates and doing everything manually page by page - which wouldn't be fun.
    Any help or suggestions would be appreciated.
    Thanks,
    Sam

    Hi alberon-sam,
    You will need to migrate your site as mentioned in this article: http://kb.worldsecuresystems.com/203/bc_2038.html?bc-partner

  • Move the contents of old file into another  before writing in applcn srvr

    Hi Friends,
    As per the requirement I need to move the contents of the previous file into an archieve folder which is being created by the previous run of the program in the application server.
    After the old file has been moved I need to craete the new file in the directory.
    So at any time only one file should be present in the application server.
    All the previous files will be in the Archieve folder.
    Please suggest how can I move the contents of the privious file in the archieve directory.
    Thanks and regards,
    Smriti Singh
    Please do not duplicate post
    Edited by: Rob Burbank on Feb 24, 2009 11:16 AM

    Hi Smriti,
    check this
    1) use the function module  'EPS_GET_DIRECTORY_LISTING' --- to gett the details of files n application dir
    eq.
    call function 'EPS_GET_DIRECTORY_LISTING'
        exporting
          dir_name               = p_file
        tables
          dir_list               = it_dir_list
        exceptions
          invalid_eps_subdir     = 1
          sapgparam_failed       = 2
          build_directory_failed = 3
          no_authorization       = 4
          read_directory_failed  = 5
          too_many_read_errors   = 6
          empty_directory_list   = 7
          others                 = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    2) then use this code to archive
    open dataset w_file1 for output in text mode encoding default. "Open Backup File
      if sy-subrc <> 0.
        write: /1 ' error creating file with status - ', sy-subrc.
        exit.
      endif.
      open dataset w_dirname for input in text mode encoding default."Open Real File
      if sy-subrc <> 0.
        error_flag = 'X'.
        write: /1 ' error opening input file with status - ', sy-subrc.
        exit.
      endif.
    *" To read the input file into a internal table
      do.
        read dataset w_dirname into inrec_lpcfab.
        if sy-subrc <> 0.
          exit.
        else.
          if not inrec_lpcfab is initial.
            append inrec_lpcfab.
            transfer inrec_lpcfab to w_file1 length 180.
          endif.
        endif.
      enddo.
      close dataset w_dirname.

  • Copy the value from one item into another

    Hi,
    I have a page with 2 items on it: Field1 and Field2. When the user enters a value in Field1 and tabs out, I want to copy the value to Field2.
    I have changed the setField1 method in the VORowImpl to call setField2 passing in the same value.
    In the JHeadstart definition file I have set the Depends On Item property of Field2 to be Field1.
    When I run the page and put a value in Field1 the page autosubmits as expected and the setField1 method runs. Unfortunately, the value does not appear in Field2.
    Any ideas?
    Thanks,
    Gavin

    Hi Steven,
    Checking the box does indeed get the value from Field1 into Field2.
    What I want to do, though, is to populate Field2 from Field1 only if Field2 is empty. Unfortunately, Field2 is now cleared before the setter of Field1 executes and so it always overwrites Field2.
    Any ideas?
    Thanks,
    Gavin

  • How to show the contents of one dropdown in another dropdown

    hi all
    i have 2 dropdownlists
    i created a dropdownkey ui and inserted values into dropdown dynamically.  let us say i have months in the dropdown , and when i select a month name in the first dropdown i want to display the festival names of that particular month in the second dropdownlist.
    please guide me
    Thanks and Regards
    narayna Adhurthi.

    Hi Narayan,
    You can achieve this functionality by following Bhavik's suggestion. If you do not want to create the second drop down's data dynamically, I can give you a suggestion.
    Create simple types for each month's festival list. Create twelve attributes each's type being one of the created festival type. Let's call these attributes attr1,attr2....attr12. On selecting a value from the first dropdown, change the binding of the 'selectedKey' of the second dropdown to a corresponding attribute.
    For this in the doModify(), write the following lines of code :
    String selected_key_for_drop1 = wdContext....get<attribute bound to the first drop down>;
    IWDViewElement elmt = view.getElement("<your second dropdown's ID>");
    IWDDropDownByKey drop = (IWDDropDownByKey)elmt; 
    if(selected_key_for_drop1.equals("Jan"))
       drop.bindSelectedKey("attr1");
    else if(selected_key_for_drop1.equals("Feb"))
       drop.bindSelectedKey("attr2");
    Hope this helps,
    Best Regards,
    Nibu.

  • How to merge the objects of one rpd into another rpd in OBIEE.

    Hi to all,
    I am new user to OBIEE. I was given a task to merge two repositories. I tried a lot but couldn't do it. I went through many forums and discussions to find the relevant answer but couldn't find anything. Actually my requirement is to merge two repositories. For example, consider two repositories namely rpd1 and rpd2 respectively. Both repositories has their own set of objects. I just want all the objects of rpd2 to merge with rpd1 under the name rpd1. Is it possible? If it is possible... Please anyone let me know the steps to do it.
    Thanks in advance
    Thenmozhi

    Hi,
    See the below URLs will help you,
    http://varanasisaichand.blogspot.com/2010/03/how-to-merge-two-repositories.html
    http://gerardnico.com/wiki/dat/obiee/bi_server/obiee_repository_merge
    http://oraclebizint.wordpress.com/2008/03/24/oracle-bi-ee-101332-merging-repositories-substitute-for-import-from-repository-2-way-merge-with-no-parent-part-2/
    Thanks,
    Balaa...

  • How to copy the data in a cube to another cube

    Hi ,I created one cube by copying.Now I want the data available in earlier cube to Copied Cube.Plz can any one help in this.
    Thanx in Advacnce
    Vasu

    You can use the export datasource option to copy the data.
    Another option is:
    The steps for copying the contents of one cube to another:
    1. Go to Manage -> Recontruct of the new cube.
    2. Select the "selection button"(red , yellow, blue diamond button).
    3.In the selection screen you can give the technical name of the old cube, requests ids you want to load, from & to date.
    4.Execute and the new cube would be loaded.
    Its all that easy!!!!!!
    Refer this link:
    Copying the structure of an Infocube

Maybe you are looking for