How to RENAME the file in UNIX-Appl. server, after READING it?

Hi Experts,
Following is my requirement,
What we are wanting here is the functionality added to this program that once the UNIX file is processed, that it can be closed and then renamed on the Application server with the yyyymmdd extension.  For example, the program reads and processes the My_file.csv file today.  Once it's finished, it then closes the file and renames it as My_file20080610.csv.  By doing this, it will prevent the same file from being run the next day in case the new file is not sent. 
So, pls. let me know that, How to RENAME is file in the UNIX - Appl. server, after reading it? obviuosly I closes it at the end.
thanq

Hi Srinivas,
You can create a My_file20080610.csv. Write the content from My_file.csv into My_file20080610.csv. Then using DELETE DATASET delete the file My_file.csv.
Thanks
Romit

Similar Messages

  • How to Rename the file in the application server?

    Hi friends.
    How to Rename the file in the application server? via abap program so pls kindly let me know thr any function module is there.
    Thanks
    With Regards
    I.Muthukumar.

    Dont think there is any quick fix way of doin this, however you can use the following sequence of dataset ops to get what you need:
    READ DATASET - retrieve contents of current AS file
    TRANSFER DATASET - create a new file on AS with the contents read in READ
    DELETE DATASET - delete the original file on AS (if TRANSFER above is successful)
    Hope this approach helps.
    Cheers,
    Aditya

  • Uploading the file into XI Appl Server (AL11)

    Hi Guys,
    Iam trying to Upload the file into XI Appl Server (AL11) using SXDA_TOOLS.Can anyone tell me the parameters that i need to pass (Object Type,Program Type,Program  etc...) in SXDA_TOOLS for uploading the file.
    Thanks,
    Kittu.

    Object type     BUS3060
    Program type    DINP
    Program         RCCLBI03
    File type        Phisical file name
    File Name       /tmp/filename.txt
    click on Copy (Ctrl+F5) and enter the source file name by selecting the presentation server from Source frame and target file name by selecting the Application server in the Target Frame.
    Hope it'll help you.
    Regards,
    Eswar.

  • How to Find the file in UNIX?

    Hello Team,
    I Have below list files and i have to find the file with latest date and time
    CHECK_300914_200747_xxaa_account_name_20140930195924.txt
    CHECK_300914_203213_xxaa_account_name_20140930203055.txt
    CHECK_300914_205625_xxaa_account_name_20140930200219.txt
    CHECK_300914_211345_xxaa_account_name_20140930200446.txt
    CHECK_300914_213836_xxaa_account_name_20140930200718.txt
    CHECK_300914_215928_xxaa_account_name_20140930201143.txt
    In a list of files "CHECK_300914_215928_xxaa_account_name_20140930201143.txt" is the latest file i.e. ddmmyy:300914 and hhmmss:215928
    Can you please help me to find the file in UNIX
    Thanks in Advance,

    touch CHECK_300914_215928_xxaa_account_name_20140930201143.txt
    touch CHECK_300914_211345_xxaa_account_name_20140930200446.txt
    touch CHECK_300914_205625_xxaa_account_name_20140930200219.txt
    touch CHECK_300914_203213_xxaa_account_name_20140930203055.txt
    touch CHECK_300914_200747_xxaa_account_name_20140930195924.txt
    ll
    total 0
    -rw-r--r-- 1 oracle oinstall 0 Oct  7 11:27 CHECK_300914_200747_xxaa_account_name_20140930195924.txt
    -rw-r--r-- 1 oracle oinstall 0 Oct  7 11:27 CHECK_300914_203213_xxaa_account_name_20140930203055.txt
    -rw-r--r-- 1 oracle oinstall 0 Oct  7 11:27 CHECK_300914_205625_xxaa_account_name_20140930200219.txt
    -rw-r--r-- 1 oracle oinstall 0 Oct  7 11:26 CHECK_300914_211345_xxaa_account_name_20140930200446.txt
    -rw-r--r-- 1 oracle oinstall 0 Oct  7 11:25 CHECK_300914_213836_xxaa_account_name_20140930200718.txt
    -rw-r--r-- 1 oracle oinstall 0 Oct  7 11:25 CHECK_300914_215928_xxaa_account_name_20140930201143.txt
    We are interesting in file with maximal values in "field" 2 and 3 assuming that fields are parts of filename separated with "_". I especially created (the file we are interested in) CHECK_300914_215928_xxaa_account_name_20140930201143.txt file to be the first created/modified file.
    find . -name CHECK_300914_215928_xxaa_account_name_20140930201143.txt
    ./CHECK_300914_215928_xxaa_account_name_20140930201143.txt
    will definitely work. But we should know the file name. As for topicstarter note it is not the case.
    ls -tr . | tail -1
    CHECK_300914_200747_xxaa_account_name_20140930195924.txt
    gave incorrect file.
    ls -l . | cut -d" " -f10 | sed 's/\(^CHECK_\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\(.*\)/\1\4\3\2\5/' | sort -r | head -1 | sed 's/\(^CHECK_\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\(.*\)/\1\4\3\2\5/'
    CHECK_300914_215928_xxaa_account_name_20140930201143.txt
    P.S.
    I much apologize for an error in back filename transformation. Correct is marked in bold red.

  • CRIO startup directory was typed STARTUP and now will not boot. How do I recover from this error or how do I rename the directory when my proxy server is read only due no startup files?

    I loaded files on the cRIO but used upper case letters for the startup directory.  Now I cannot access the RIO since it didn't boot. The proxy server comes up read-only so I can't reload the files or change the directory.  I tried the RS232 port but I can't get it to respond to commands even though I can see the processor boot.

    lockmas wrote:
    I loaded files on the cRIO but used upper case letters for the startup directory.  Now I cannot access the RIO since it didn't boot. The proxy server comes up read-only so I can't reload the files or change the directory.  I tried the RS232 port but I can't get it to respond to commands even though I can see the processor boot.
    There is NO need to put your entire question into the subject line of your post.
    cRIO will not boot is a suitable subject line

  • Help ...how to get the file size on a server

    Hi.I use this code to parse a file that is on a server.
    The question is: how can i get the file size (bytes size)?
    Thanks.
    //Open the file for reading:
    URL u = new URL(entry);
    InputStream inputXML = u.openStream();
    //Build document:
    DocumentBuilder builder = factory.newDocumentBuilder();
    doc = builder.parse(inputXML);

    Try this instead:
    URL u = new URL(entry);
    URLConnection conn = u.openConnection();
    // get the file size
    int size = conn.getContentLength();
    // open the input stream from the URLConnection (which is functionally the same as opening it directly from the URL)
    InputStream inputXML = conn.getInputStream();
    Shaun

  • How to  open the file writer for next entry after stream is close?

    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.Scanner;
    public class TryOut {
         public static void main(String args[]) throws IOException{
              int inputQuestionnAireNum = 0;
              int inputPostCode = 0;
              int inputGender = 0;
              int inputAge = 0;
              int x=0;
              Scanner input = new Scanner(System.in);
              FileWriter fwrite = new FileWriter("tryout.txt", true);
              BufferedWriter out = new BufferedWriter(fwrite);
              boolean invalidNum = false;           
              do{
                   System.out.print("1 new entry or 0 print");
                   x = Integer.parseInt(input.nextLine());  
                   if(x == 1)
                      //Questionnaire Number
                        System.out.print("Enter Questionnaire Number [ ] ");
                        inputQuestionnAireNum = Integer.parseInt(input.nextLine());
                        out.write("NumBER OF Q: "+inputQuestionnAireNum+", ");
                        //Postal code
                        System.out.print("Enter Postal Code [ ] ");     
                        inputPostCode = Integer.parseInt(input.nextLine());
                        out.write("PostCode: "+inputPostCode+", ");
                        //Age
                        System.out.print("Enter Age [ ] ");
                        inputAge = Integer.parseInt(input.nextLine());
                        out.write("Age: "+inputAge+", ");
                        //Gender
                        System.out.print("Enter Gender '1' for Male and '2' for for female [ ] ");
                        inputGender = Integer.parseInt(input.nextLine());
                        out.write("Gender: "+inputGender+", \n");
                        out.close();          
                           } while(x != 0);
         Result:
    1 new entry or 0 print1
    Enter Questionnaire Number [ ] 2
    Enter Postal Code [ ] 1
    Enter Age [ ] 3
    Enter Gender '1' for Male and '2' for for female [ ] 4
    1 new entry or 0 print1
    Enter Questionnaire Number [ ] 2
    Exception in thread "main" java.io.IOException: Stream closed
         at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:98)
         at java.io.BufferedWriter.write(BufferedWriter.java:203)
         at java.io.Writer.write(Writer.java:126)
         at TryOut.main(TryOut.java:31)
    Hi, how can i open the file writer stream again for next entry after it is has been closed? if i do not close(); all my entry will not be recorded to the text file. how can i solve this ?
    Edited by: metaroot on Feb 18, 2008 6:39 PM

    The short answer to your question: use out=new BufferedWriter(fwrite) inside the do loop as well.The only difference that would make would be to make the problem worse. It is poor practice. Stream stacks should be constructed once for the life of the stream.
    What he needs to do is close his stream outside the loop, possibly calling flush() where he presently has close().
    The more relevant answer is: Why are you not wrapping the user-friendly PrintWriter class, wrapping it around the BufferedWriter?Possibly because he doesn't like the fact that PrintWriter swallows exceptions? which makes it less user-friendly IMO.
    The println and print methods are very useful, and do not need closing between loop iterations.Neither does anything else.
    By the way,you say that without a close() the BufferedWriter doesn't output to the file.I don't know: I never used/tried it.Even if it doesn't, it will surely output after you come out of the loop.If you don't want to use a PrintWriter, why don't you investigate this?Posting guesses here isn' t really much help, especially about something you've never used. A BufferedWriter has a buffer and it doesn't write anything until the buffer is full, you flush it, or your close it.

  • How to Save the  file into R/3 Server Path

    Hi Friends,
    I have one Query on WDJ. Here I have two requirements.
    I have done click on u201CExport Excelu201D Button that data was download into Excel file Now my requirement is click on Save Button that file will save into (/exchange/CED) this path of R/3 System.
    CED -
    >is R/3 System ID
    Under System id we can save this file.
    Here EP Server and R/3 Servers in Diff Systems.
    I was write codeing
    InputStream text =      null;
         int temp = 0;
         try
         File file =      new File(wdContext.currentContextElement().getResource().getResourceName().toString());
    //       String File = "abc.xls";
    //       String file = "anat" + ".xls";
         wdComponentAPI.getMessageManager().reportSuccess("File::"+file);
         FileOutputStream op =      new FileOutputStream(file);
    //       FileOutputStream op = new FileOutputStream("D://usr//sap//BPE//"+file);
    //       FileOutputStream op = new FileOutputStream("D://KumarDev-BackUp//"+file);
         wdComponentAPI.getMessageManager().reportSuccess("op::"+op);
         if (wdContext.currentContextElement().getResource()!= null)
         text = wdContext.currentContextElement().getResource().read(false);
         while((temp=text.read())!= -1)
         op.write(temp);
         op.flush();
         op.close();
    //        path = file.getAbsolutePath();
         path =      "/exchange/CED/"+file;
         wdComponentAPI.getMessageManager().reportSuccess("path:"+path);
         catch(Exception ex)
              wdComponentAPI.getMessageManager().reportSuccess("ex.printStackTrace()");
    My Req is that file will saved in this path (path =      "/exchange/CED/"+file; )
    Regards
    Vijay Kalluri
    Edited by: KalluriVijay on Apr 20, 2010 11:01 AM

    Hi Friends,
    I have one Query on WDJ. Here I have two requirements.
    I have done click on u201CExport Excelu201D Button that data was download into Excel file Now my requirement is click on Save Button that file will save into (/exchange/CED) this path of R/3 System.
    CED -
    >is R/3 System ID
    Under System id we can save this file.
    Here EP Server and R/3 Servers in Diff Systems.
    I was write codeing
    InputStream text =      null;
         int temp = 0;
         try
         File file =      new File(wdContext.currentContextElement().getResource().getResourceName().toString());
    //       String File = "abc.xls";
    //       String file = "anat" + ".xls";
         wdComponentAPI.getMessageManager().reportSuccess("File::"+file);
         FileOutputStream op =      new FileOutputStream(file);
    //       FileOutputStream op = new FileOutputStream("D://usr//sap//BPE//"+file);
    //       FileOutputStream op = new FileOutputStream("D://KumarDev-BackUp//"+file);
         wdComponentAPI.getMessageManager().reportSuccess("op::"+op);
         if (wdContext.currentContextElement().getResource()!= null)
         text = wdContext.currentContextElement().getResource().read(false);
         while((temp=text.read())!= -1)
         op.write(temp);
         op.flush();
         op.close();
    //        path = file.getAbsolutePath();
         path =      "/exchange/CED/"+file;
         wdComponentAPI.getMessageManager().reportSuccess("path:"+path);
         catch(Exception ex)
              wdComponentAPI.getMessageManager().reportSuccess("ex.printStackTrace()");
    My Req is that file will saved in this path (path =      "/exchange/CED/"+file; )
    Regards
    Vijay Kalluri

  • How to rename a file in Application server

    Hi All,
    Here I have a issue with  the present file which is being generated in application server.
    Before the completion of the file the EDI tool is extracting the file from the app server.So here I would like to generate the file with a temp name and then rename to the actual file name which EDI recognises and fetches.
    Please correct me If I am wrong and let me know how to rename the file in application server.
    Thanks,
    Vijay N

    you can try using unix command , if your application server is unix.
    use move command
    mv   <source>  <target>
    REPORT ZUNIX line-size 400
                    no standard page heading.
    data: unixcom like   rlgrap-filename.  
    unixcom = 'mv file1 file2'.
    data: begin of tabl occurs 500,
            line(400),
          end of tabl.
    data: lines type i.
    start-of-selection.
      refresh tabl.
      call 'SYSTEM' id 'COMMAND' field unixcom
                    id 'TAB'     field tabl[].
    or else you can open dataset/ read the dataset and move it to another file and delete the old file.

  • How to change the file main.html in catalyst?

    My Web Hosting can not accept files with main.html, only with index.html. How to rename the file in Catalyst? Please do not tell me I have to go to the builder to do this.
    here is the link: http://www.insight-gd.com  and see what comes up.
    thx
    Mike

    chris, I'm in open war with the people from my server hehehe, they say that it is possible to accept the domain main.html. But my question is if I return the letter M by m, will not interfere in other files?
    thx
    Mike

  • How to get the file path of selected file using JFileChooser

    Hi All,
    I am trying to store the file on my FTP server after selecting the file from the user workstation using JFileChooser. But I am not able to write the file on FTP server or on user local machine where application is running. I am new to this FTP server coding. Can anyone help me in this.
    This is the code I wrote on button click user will able to select the file:
    String filename1;
    File file;
    JFileChooser fc = new JFileChooser();
    fc.showOpenDialog(this);
    file = fc.getSelectedFile();
    filename1 = file.getPath();
    txtFilePath.setText(filename1);
    Below is the code to write the file on my local machine first:
    BufferedWriter outFile = new BufferedWriter( fileName ) );
    outFile.write();
    outFile.flush( );
    outFile.close( );
    Any help will be greatly appriciated

    rp0428 wrote:
    >
    BufferedWriter outFile = new BufferedWriter( fileName ) );
    >
    There is NOTHING named 'fileName' in any of the code you posted so that code can't possibly compile let alone actually run.
    How can anyone help you if you won't post the actual code you are using?Its just a random snippet of other code that is totally irrelevant to this thread if you ask me.

  • How do I import old FCP projects that have mysteriously changed to Linux Executable files?  Is it as simple as renaming the files with the.fcp extension?

    I had some FCP projects on an old G3 tower that I finally want to finish. I was able to grab everything, media, etc. to my macbook pro but all of the Final Cut Pro actual movies/projects have turned into "linux executable files" that FCP X won't import.
    I tried googling this issue but didn't really see any good answers. Would it be as simple as renaming the files with the .fcp extension?  I can't recall if my old version (really old) of FCP saves projects as .mov or .fcp files, but I'm assuming I'm not the only person this has happened to.
    Thanks for your help!

    I had some FCP projects on an old G3 tower that I finally want to finish.
    What version of FCP was this? The project files can probably no longer be opened in the newer version of the OS. You could try adding the .fcp suffix, but I don't think it will help for this. Projects files are .fcp.
    Regardless of the version, no legacy FCP projects will import into FCPX.
    Media is a different matter. These are probably QuickTime .mov files. If these are appearing as Unix ececutables, they're probably not recoverable either.

  • "The file 'iTunes Library.itl' cannot be read because it was created by a newer version of iTunes." Updates were only offered by Apple when I'd open iTunes. Now I can't open iTunes. How can I access the newest iTunes as an update, not a new program?

    "The file 'iTunes Library.itl' cannot be read because it was created by a newer version of iTunes." Updates were only offered by Apple when I'd open iTunes. Now I can't open iTunes. How can I access the newest iTunes as an update, not a new program?

    this just started w/ me yesterday.  I was running 10.5.3, and nothing changed - the message just appeard out of nowhere.  I update to the latest iTunes 10.6 but the message is the same.
    Sounds like probably some sort of Library file corruption.
    The two options available in the message box are "Download" and "Quit".  Download is useless because I'm already running the latest.  Quit is pretty useless.
    I was going to just create a new Library and re-import all my music.  Of course, all my iPhone sync settings are going go have to be recreated.

  • How to rename the SharePoint Document Library existing file name using Web service

    Hi,
    How to rename the SharePoint Document Library existing file name using SharePoint Web service.
    Is it possible. How could i do it?
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Lists.UpdateListItems Method
    would be helpful for your requirement.
    Here is a blog with code demo for your reference:
    http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once before. Recently that isn't happening. How do I get that feature back?

    When downloading, previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once. Now that isn't happening. How do I get that feature back?

    When downloading, previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once. Now that isn't happening. How do I get that feature back?

Maybe you are looking for

  • In LR5, the slideshow does not update with new photos taken by a tethered camera

    Hi Everyone, I'm just trying out LR5 and have found a problem - I've watched vidoes where in LR4 you can setup a slideshow to play from a folder, and while the slideshow is playing you can take new photos from a tethered camera and it will automatica

  • Question about using file objects

    Hi, I have two somewhat related issues in using file objects. In one app, a simple swing gui that passes a file to a sax parsing class and reports back any errors, if I parse a file using the app, then try to edit the file I'm parsing (in another app

  • Mass processing of MRP areas

    Hi All, Is there any way to mass processing of MRP Areas in Material master? We want to create MRP areas for a number of materials. regards, Mohit

  • Document Nos in CO...

    Hi, I have run one report in "CO", and now when the report has been displayed it also has a column for document no.. I want to enter the document no which has been displayed in the report, so is there any t code to veiw the document no which has been

  • How can I view software updates?

    ML now appears to take me to the App Store app for OS updates, etc.  I don't see an option now that allows me to view the updates I've applied to my machine.  I'm specifically thinking of firmware updates, etc., like the SMC update for the Power Nap.