Writing agents o/p to external file and if i run the agent again it should

Hi All,
i want to run a agent and that result should be displayed in external file system.and i achieved this by using writing VB script and in agents i used actions in that we have invoke server script.And i got the perfect output but what 's my scenario is when i run the agnent again it should create another file with below requirements.
The file name must contain a suffix containing the date in yyyymmdd format. In cases where the file stored more than once per day, a sequence number must also be provided within the filename.
(i.e. v1_yyyymmdd, v2_yyyymmdd, v3_yyyymmdd, v4_yyyymmdd, v5_yyyymmdd…)
And my VB script is like below
'#####=========================================================================
'## Title: Export Report
'## Rev: 1.0
'## Author: Paul McGarrick
'## Company: Total Business Intelligence / http://total-bi.com
'## Purpose:
'## 1. This script takes a file from OBIEE and saves to the file system
'## 2. Creates a reporting subdirectory if not already present
'## 3. Creates a further subdirectory with name based on current date
'## Inputs (specified in Actions tab of OBIEE Delivers Agent):
'## 1. Parameter(0) - This actual file to be exported
'## 2. Parameter(1) - The filename specified within OBIEE
'## 3. Parameter(2) - Report sub directory name specified within OBIEE
'#####=========================================================================
Dim sBasePath
sBasePath = "E:\reports\reports"
Dim sMasterPath
sMasterPath = sBasePath & "\" & Parameter(2)
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'check whether master directory exists, if not create
Dim objMasterDir
If Not objFSO.FolderExists(sMasterPath) Then
     Set objMasterDir = objFSO.CreateFolder(sMasterPath)
End If
Set objMasterDir = Nothing
'build string to get date in yyyy-mm-dd format
Dim sDate, sDateFull
sDate = Now
sDateFull = DatePart("yyyy", sDate) & "-"
If Len(DatePart("m", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("m", sDate) & "-"
If Len(DatePart("d", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("d", sDate)
Dim sDir
sDir = sMasterPath & "\" & sDateFull
Dim objDir
If Not objFSO.FolderExists(sDir) Then
     Set objDir = objFSO.CreateFolder(sDir)
End If
Set objDir = Nothing
Dim sFileName
sFileName = sDir & "\" & Parameter(1)
Dim objFile
objFSO.CopyFile Parameter(0), sFileName, True
Set objFile = Nothing
Set objFSO = Nothing
could you please any body help me out from this....

I assume you are using Windows. Try to write a batch file so that that would look for the ibot name when ever its finds rename the file name as required.
This would be easiest way..
http://lmgtfy.com/?q=rename+a+file+to+current+date+using+batch+file
Edited by: Srini VEERAVALLI on Apr 8, 2013 7:23 AM
Can you updates all your posts?
Edited by: Srini VEERAVALLI on May 13, 2013 6:44 AM

Similar Messages

  • In Flash CS6 when I embed all glyphs in a text field it corrupts the file and during a run the text

    the text no longer shows up for all texts.
    Is there a fix for this bug in CS6 flash or a work around?  I actually have to bust out the older machine and do my dev work on that.  I am wondering why I upgraded.  Please help.

    There's a Fourm for Flash Professional... this, unfortunately, isn't it.

  • How to slipt  fields in a row of an external file and store in Table

    Hi Experts,
    I need to proces an External file and store into a table. Here need to Split the fields in a row and write as multiple rows of a table.
    here i am giving the data sample ..
    outlet1     type1     type2     type3          
    outlet2     type1     type3     type4     typ6     type7
    The table  should be as below.
    outlet1     type1
    outlet1     type2
    outlet1     type2
    outlet2     type1
    outlet2     type3
    outlet2     type4
    outlet2     type6
    outlet2     type7
    Please give your suggesions and code sample that you have
    Thanks

    hi,
    try with the below code. This code is as per data given by u in your first thread.
    DATA : it_string TYPE TABLE OF string,
           wa_string TYPE string,
           BEGIN OF it_itab OCCURS 0,
           f1(7),
           f2(5),
           END OF it_itab,
           fld TYPE TABLE OF string,
           wa TYPE string,
           wa1 TYPE string,
           cnt TYPE i VALUE 1.
           data lin TYPE i.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = 'C:\Documents and Settings\User\Desktop\abc.txt'
        filetype                = 'ASC'
        has_field_separator     = 'X'
      TABLES
        data_tab                = it_string
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    *  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    BREAK-POINT.
    LOOP AT it_string INTO wa_string.
      cnt = 1.
      SPLIT wa_string AT space INTO TABLE fld.
      DESCRIBE TABLE fld LINES lin.
      LOOP AT fld INTO wa.
        cnt = cnt + 1.
        IF cnt <= lin.
          READ TABLE fld INTO wa INDEX 1.
          IF sy-subrc = 0.
            it_itab-f1 = wa.
          ENDIF.
          READ TABLE fld INTO wa1 INDEX cnt.
          IF sy-subrc = 0.
            it_itab-f2 = wa1.
          ENDIF.
          APPEND it_itab TO it_itab[].
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    Thanks & Regards

  • I have 60 000 songs on a hard drive. The songs are referenced to the media file and not stored in the media file. I have moved the songs to another external drive. The itunes library has lost the link to the media files. How can I restore the links?

    I have all my songs (60 000) on a remote drive. The drive is wireless networked. I installed a new router and had to map the drive again. Once this was done itunes could no longer locate the music. My music is not sitting in my media file but is rather referenced to the location of the music. Now that the location has changed due to the remapped drive how can I link the itunes library to the songs (media)again.
    I have read many help comments and forums but so far nothing specific about relinking once the songs have already been moved and are referenced songs.
    A step by step procedure would be helpful.
    Thank you
    Graham

    I've uploaded a newer version that might catch that error. For some background on the script look at this thread.
    iTunes remembers the location of each file in the database. If you right-click on a missing file, click Get Info, cancel when it asks you to try to find it, then look on the summary tab it will show you the last known location in the form file://localhost/<some path>. If you put the files back where they are expected to be, close iTunes and reopen, then iTunes will find them again. If not my script can attempt the task. When the script asks for a media folder you should respond with Z:\ since that seems to be where the artist folders are located.
    tt2

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • After reinstalling CS6 the bridge photo downloader isn't able to read raw files and fails to convert the raw files to DNG. Previously downloaded raw files, now DNG, open up successfully in Camera Raw 7. How do I get the photo downloader to read and conver

    After reinstalling CS6 the bridge photo downloader isn't able to read raw files and fails to convert the raw files to DNG. Previously downloaded raw files, now DNG, open up successfully in Camera Raw 7. How do I get the photo downloader to read and convert raw files. MacBook Pro with Snow Leopard. No such problem before this reinstallation.

    You should install Camera Raw 4.6.
    Visit this page and follow the instructions carefully:
    PC:    http://www.adobe.com/support/downloads/detail.jsp?ftpID=4040
    Mac:  http://www.adobe.com/support/downloads/detail.jsp?ftpID=4039
    -Noel

  • I exported an archive of iCal from a computer running the last OS X. On a new computer running OS X (10.7.4), I tried to import the .icbu file and got a message "The calendar failed to restore". How do I fix this/get my calendar?

    I exported an archive of iCal from a computer running the last OS X. On a new computer running OS X (10.7.4), I tried to import the .icbu file and got a message "The calendar failed to restore". How do I fix this/get my calendar?

    I exported an archive of iCal from a computer running the last OS X. On a new computer running OS X (10.7.4), I tried to import the .icbu file and got a message "The calendar failed to restore". How do I fix this/get my calendar?

  • I've tried to install flash player several different times ans each time i get a connection error message.It downloads fine and when i run the file to start install,it installs up to 5% and then i get the connection error message.Can someone please help m

    I've tried to download the flash player several different times and each time i get a connection error message.It downloads fine and when i run the file to start install, it installs up to 5% and then i get the connection error message. I've tried disabling my antivirus software, closing my browser for install and nothing.Can someone please help me? I'm using Firefox.

    Hi!
    I had the exact same issue, being on a mac. If you are on a mac and the connection error message occurs, then use this link http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_osx.dmg
    It allows you to download it offline, which is what I used.
    Hope I was help!
    -Haroon

  • HT3775 i have a movie in a .avi file and when i open the file it attempts to convert and gives me an error message

    I have a movie in an .avi file and when i open the file the Mac attempts to covert the file and it doens't play.  What can I do?

    VLC will play avi's, even if the index is broken. IT can repair most broken avi's but will still play them if it can't.
    VLC Media Player

  • How to make blank copies of a PDF file and put it into the printer tray.

    Dear experts,
    Before you try printing the data from the FM, How tomake several blank copies of the PDF file  and  put it in the printer tray so that you can print just the data from the function module on it??????
    Please reply.

    Hi drredwood,
    When you open your PDF file a yellow bar will appear on the top of the screen.
    Click on 'Enable All Features'.
    Then you will be able to copy the content from your pdf and to paste in any of the file.
    Regards,
    Florence

  • Hi i am new to labview. i want to extract data from a text file and display it on the front panel. how do i proceed??

    Hi i am new to labview
    I want to extract data from a text file and display it on the front panel.
    How do i proceed??
    I have attached a file for your brief idea...
    Attachments:
    extract.jpg ‏3797 KB

    RoopeshV wrote:
    Hi,
    The below code shows how to read from txt file and display in the perticular fields.
    Why have you used waveform?
    Regards,
    Roopesh
    There are so many things wrong with this VI, I'm not even sure where to start.
    Hard-coding paths that point to your user folder on the block diagram. What if somebody else tries to run it? They'll get an error. What if somebody tries to run this on Windows 7? They'll get an error. What if somebody tries to run this on a Mac or Linux? They'll get an error.
    Not using Read From Spreadsheet File.
    Use of local variables to populate an array.
    Cannot insert values into an empty array.
    What if there's a line missing from the text file? Now your data will not line up. Your case structure does handle this.
    Also, how does this answer the poster's question?

  • How to synchronize if one servlet read a file and anothe servlet update the

    How to synchronize if one servlet read a file and anothe servlet update the file at a time?

    Create a class that holds the reference to the file and do the whole file manipulation just in that class. than synchronize the read and write methodes. A reference to this file handler class can be stored to the servlet context in one servlet and read out from the servlet context in the other servlet.

  • Reinstalling AE and PP due to an error with dynamic link. Where do i find the program install? And tips on how to reinstall without messing things up? last question is, does my recent files and saves work after the reinstall?

    I have allready bought the programs, but need to reinstall AE and PP due to an error with dynamic link.
    Where do i find the program install?
    And tips on how to reinstall without messing things up?
    last question is, does my recent files and saves work after the reinstall?
    Thank you

    karianne wrote:
    I have allready bought the programs, but need to reinstall AE and PP due to an error with dynamic link.
    Where do i find the program install?
    Which versions? Which operating system?
    Try Download and Installation Help

  • IMac: I try to save a file and get 'the action "Copy Finder Items" encountered an error.  Check the action's properties and try running the workflow again.'

    I keep on running into this when I try to save a download file. Any help would be appreciated.
    'The action "Copy Finder Items" encountered an error.  Check the action's properties and try running the workflow again.'
    I tried clicking the button to change the save but that has no effect.

    Hi All,
    I am having same issue too.  Can anyone you advise?  Thank you.

  • I can record and hear me recording through the computer's built in mic, but can't get the external mic and headphones to work., The preferences are set for the external mic and headphones...

    I can record and hear me recording through the computer's built in mic, but can't get the external mic and headphones to work., The preferences are set for the external mic and headphones...

    What operating system are you using? Is it on a Mac or a PC? Which preferences are set for external mic/headphones, Audition's or the computers?

Maybe you are looking for

  • CPU & Graphics Card Upgrades

    Hi, I do a lot of video and graphics on my Mac Pro 1,1 and would like to upgrade the CPU and graphics cards. I see the CPU may be a trickier install process, but it looks like I'll have no trouble changing out the graphics card. I'll probably just pa

  • Disk space usage by table

    Hi all, how do I determine disk space usage by table1, table2 ?

  • I'm going crazy!

    Can someone tell me how to stop this **** computer from telling me everything I'm doing? I must have pressed something accidentally and now everytime I click on a new window or a type something there is this Stephen Hawking-type voice speaking the ac

  • Production version issue.

    Dear Guru's,      I have created two version in material master. also I have changed in "opl8"{ production version = Manual selection of production version} but still system is not asking me for production version at the time of creation of productio

  • HT2422 HELP

    How to share files with Windows NT File System (NTFS) WD Hard Disk with MacBook by not formatting their hard disk ?