Pick the file with dynamic name

Dear All
My scenario is file to idoc.
legacy system generates file with a file name as current date.txt which keeps on changing
eg:   on 9th july file name is 09072009.txt and
       on 10thjuly filename would be 10072009.txt
How do i pick such file and process it?
What should be the File Name in the sender communication channel?
Please help me in resolving this issue
Thanks
Bhasker

Hello Baskar Raj,
    Your requierement can be acheived by using the combination of UDF and ASMA(AdapterSpecifieMessageAttriburrtes) which helps us greatly in meeting dynamic filename rquirements.
1.You have to enable either FIlename,Time stamp or all the he ASMA in the sender side communication channel .
2.Write the UDF that gets the file name (CURRENT DATE.txt)during runtime that is available from enabling ASMA in sender communication channel .
3.change it to the name u want to modify (Replace with the new file name by getting time stamp from the ASMA attributes.
4. Map the UDF output to any of the target nodes(can be messagetype node MT_ur msg type name).
5.Enable ASMA on the target side also in that chek same file name.
Code to be writen in UDF is mentioned by sunilchandra in the below thread u jus need to avoid filename in that and use only date format it will acheive ur requrement.
Re: Regarding Target File name
Thanks,
Ram.

Similar Messages

  • Recive a file with dynamic name

    Hi All,
    I want to receive a file with dynamic name containing date stamp to it.... eg File_20080123.txt , File_20080122.txt etc.
    Can anybody suggest how to do it?
    Thanks,
    Atul

    Atul,
    Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
    Have u tried this option?
    See the below Solution
    Check the ASMA File for both sender/receiver channels.
    Write the below code UDF in mapping program
    //Get Input date. Don't pass anything to this UDF except the Date.
    //Map the output to the root node of the target.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fname = conf.get(key);
    String ret = fname"_"Date
    return "";
    raj.
    Edited by: Raj on Jan 23, 2008 4:09 PM

  • FTP Activity - mget multiple files with dynamic names

    Hello All
    Hope all is well.
    I was wondering if there was a way to configure FTP activity to transfer multiple files with dynamic names from source location at daily intervals.
    For example, my source files are affixed with date values (source_filename_<mmddyyyy>_<hh>.txt):
    source_filename_12252009_00.txt
    source_filename_12252009_06.txt
    source_filename_12252009_12.txt
    source_filename_12252009_18.txt
    What I would like my process flow to do would be to download just these 4 files once daily based on a dynamic ftp script as follows:
    open ${Remote.Host}
    ${Remote.User}
    ${Remote.Password}
    cd ${Remote.RootPath}
    prompt off
    mget ????????
    quit
    In DOS batch script you would have the mget command with a wildcard as:
    mget source_filename_%DATE:~0,2%%DATE:~2,2%%DATE:~4,4%*.txt
    How does one go about implementing this in OWB? Does it require a user defined substitution varilable of some sort?
    FYI, I am using version 10gR2.
    Cheers.

    Hi ,
    If you are able to achieve your objective from a DOS batch script then you can call that script for an User Defined Activity in OWB process flow .
    Hope this helps.
    Thanks,
    Sutirtha

  • How can I automatically create the files with serie-name?

    Hello, Everyone,
    I have a question again.
    How can I automatically create the file with a serie-filename?
    e.g. I have a program, it will repeat 5 times, and every time it will create a bmp-file, and I want to let this program automatically save these 5 files with a Serie-filename like File001.bmp, File002.bmp, .... File005.bmp.
    How can I do it?`
    Thanks a lot.
    Regarts,
    Johnny

    Hi Deepu,
    one more comment
    The format code should be "%04d" to get leading zeros and have filenames with same length...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Need to Pick the file with continious records in File Sender

    Hi,
    I am Working with File to Idoc Scenario. Where I am using Field Fixed length as FCC. The fixed length of each record is 200.
    I am able to pick the first 200 characters.
    For example:
    If the file has 600 characters continiously. The first 200 belong to first record and second from 201 to 400 and so on.
    How can i control this in File adapter.
    Regards,
    Manoj

    Your data type record should have an occurence of 0..unbounded or 1..unbounded. In file content conversion, leave the recordset per message empty.
    Let's say you have the following structure:
    DT_MAIN_SEGMENT (0..1)
      RECORDSET (1..unbounded)
    In file content conversion, DT_MAIN_SEGMENT will be your recordset name and RECORDSET will be your recordset structure.

  • Tag File with dynamic name

    I need to include a page with a name I do not know in advance. I can do this with <jsp:include page="${filename}"/>.
    Can I also do it somehow using tag files?

    Atul,
    Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
    Have u tried this option?
    See the below Solution
    Check the ASMA File for both sender/receiver channels.
    Write the below code UDF in mapping program
    //Get Input date. Don't pass anything to this UDF except the Date.
    //Map the output to the root node of the target.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fname = conf.get(key);
    String ret = fname"_"Date
    return "";
    raj.
    Edited by: Raj on Jan 23, 2008 4:09 PM

  • OSB file Write, not naming the file with specific name.

    Hi ALL,
    I have a requirement, i should accept the data or XML file from from JMs queue and place it in a location specified. For this i have build the PS and BS.
    Where PS will De-queue the JMS queue and route using Service call out to BS. And the BS will place the file in location. I could do this easily. BUT the thing is that i could not name the file perfectly with the intended file name. to build the BS i used .JCA file , .WSDL file, XML file from Jdeveloper. and imported to osb console. i could write the file as follows..
    MY business Services:
    services TYPE : ANY XML services
    transport
    Protocol ==> file
    Load Balancing Algorithm ==> round-robin
    Endpoint URI ==> file:///oracle/Middleware/user_projects/domains/Agile
    Request encoding ==> utf-8
    this is the file name i am getting:
    <con:metadata      xmlns:con="http://www.bea.com/wli/sb/test/config">
         <tran:response-code      xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
         <tran:encoding      xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
         <file:filePath      xmlns:file="http://www.bea.com/wli/sb/transports/file">
         /oracle/Middleware/user_projects/domains/Agile/POTest3338620552690675292--411054fa.1363686ca89.3e8d.xml
         </file:filePath>
    </con:metadata>
    the file NAME : POTest3338620552690675292--411054fa.1363686ca89.3e8d.xml ( POTest is prefix and .xml is Sufix)
    3338620552690675292--411054fa.1363686ca89.3e8d i dont know y the this garbage file name is created...
    please give suggestions to avoid garbage name
    thanks --
    ANIL

    Hi ALL,
    I have a requirement, i should accept the data or XML file from from JMs queue and place it in a location specified. For this i have build the PS and BS.
    Where PS will De-queue the JMS queue and route using Service call out to BS. And the BS will place the file in location. I could do this easily. BUT the thing is that i could not name the file perfectly with the intended file name. to build the BS i used .JCA file , .WSDL file, XML file from Jdeveloper. and imported to osb console. i could write the file as follows..
    MY proxy services:
    services type : any XML services
    protocol :jms
    MY business Services:
    services TYPE : ANY XML services
    transport
    Protocol ==> file
    Load Balancing Algorithm ==> round-robin
    Endpoint URI ==> file:///oracle/Middleware/user_projects/domains/Agile
    Request encoding ==> utf-8
    this is the file name i am getting:
    <con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    <file:filePath xmlns:file="http://www.bea.com/wli/sb/transports/file">
    /oracle/Middleware/user_projects/domains/Agile/POTest3338620552690675292--411054fa.1363686ca89.3e8d.xml
    </file:filePath>
    </con:metadata>
    the file NAME : POTest3338620552690675292--411054fa.1363686ca89.3e8d.xml ( POTest is prefix and .xml is Sufix)
    3338620552690675292--411054fa.1363686ca89.3e8d i dont know y the this garbage file name is created...
    i am getting this error when i process test from proxy services then i may use route and change it as Use Routing Options on the Service Callout and override the header (jca.file.FileName).
    but the thing is when i test from Business services also i am getting the same garbage name on both window and linux.
    please give suggestions to avoid garbage name
    thanks --
    ANIL

  • Source files with dynamic name

    Hi,
    Is there a way to load from a variable file name sources, for example file name with date postfix, something like this: INPUT_DEPT_20070313.txt ??
    Or i must create an external process in the process flow wich is to rename the file every time to a fix name then load ??
    Thanks.

    Correct. If you are using SQL*Loader mapping, then put a transformation before the mapping in your process flow. If you are using external tables (PL/SQL mapping), then put a premapping procedure in the mapping. And yes, use UTL_FILE package to rename the file.
    Greetings,
    Mate

  • SSIS 2008 - Sending file with dynamic name using FTP task

    Hi  - Thanks for taking a look -  (I'm very new to SSIS.)
    I'm trying to create an SSIS 2008 package that does the following:
    1) Execute a stored procedure on SQL.
    2) Download the results as a CSV file to a 'local' location.  The file name is set using a variable ("User::LocalFilePath") dynamically based on the current time:
    @[User::LocalFilePath] + "GreatReportName_" + "_" +(DT_STR,4,1252) DatePart("yyyy",getdate()) + Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) + "_" + Right("0"
    + (DT_STR,4,1252) DatePart("d",getdate()),2) + "_" + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) +  "_" + Right("0" + (DT_STR,4,1252) DatePart("mi",getdate()),2)
    + "_" +  Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) + ".csv"
    3) Transfer the CSV file to an FTP site.
    4) Delete the CSV file from the 'local' location.
    I've been able to do steps 1 and 2 so far.  However when trying the move the newly created file to the FTP site I get the error:
    "Error: 0xC002917C at Send to FTP, FTP Task: The variable "User::LocalFilePath" doesn't contain file path(s)."
    (When I set the "IsLocalPathVariable" to "False" and use a file previously created the file is correctly transferred to the FTP site.  This proves that the FTP details are correct and that the "RemotePathVariabe" is working
    correctly.)
    I have set the variable ("User::LocalFilePath") to "EvaluateAsExpression" in the variable properties.
    Can anyone help?
    Many Thanks,
    UnoT

    Hi Vaibhav,
    Thanks for your response.  I set the "DelayValidation" to "True".  However
    that didn't make any difference.
    I added in all the breakpoints, but it didn't give any results (I may be doing this incorrectly?):
    Any other suggestions?
    Thanks,
    UnoT

  • How to specify Sql Loader input file with dynamic name

    The input file name likes pochange_YYYYMMDD.dat which is generated by other program each day.
    I want to load this file to a table.
    Any help? Thanks a lot

    I thought in an excellent strategy to do this:
    Conditions:
    - you have to have only one file in the folder with the data.
    - Independently of the name of that file. A process is always going to change its name to a fix name.
    - the controlfile must at another fixed path
    the scripts is this one:
    joel_sqlloader.bat
    ren *.dat always.txt
    sqlldr <user>/password data=always.txt control=<another_path>/my_ctl.ctl
    - In a folder you will have these files:
    * joel_sqlloader.bat
    * pochange_YYYYMMDD.dat
    - In another folder you will have:
    * my_ctl.ctl
    Did you get it ?
    Joel Pérez
    http://otn.oracle.com/experts

  • Sener file adapter has read/pick the files first in first out method.

    HI
    In my Interface I am Using Sender as File adapter. As per my requirement Sender file adapter has to read the file from file directory. This directory having 1000u2019s of files with some files are same name (time stamp is different) and some files are different name here file adapter has to pick the file with mentioned name   in File sender adapter like ZMPSMSGSTATUSMST-.xml .
    But source file name is like <TABLENAME>-<TIME_STAMP>.XML (ZMPSWRKFLOWHIST-20090527-150522-628) in file directory.
    The file adapter in XI will poll to this directory and picks the file in first- in first-out by sorting according to timestamp.
    To do this configuration what I have to do in sender file adapter please give me your valuable inputs.

    HI Abhi,
    Thank you for your spot replay.
    I tested now but i am geting below error.
    Putting message into send queue failed, due to: com.sap.aii.af.ra.ms.api.DuplicateMessageException: Message ID f4ca4f86-9c5d-4bdd-1fb1-a6bd7cda99a8(OUTBOUND) already exists in database: com.sap.sql.DuplicateKeyException: [NWMss][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK__XI_AF_MSG__491A1D0B'. Cannot insert duplicate key in object 'dbo.XI_AF_MSG'..
    Could not archive file 'E:\file\in\ZMPSMSGSTATUSMST-20090527-150522-628.xml' after processing
    but i am able to see this file in Archive foleder. once file is archivied sucessfully the same file is delted from source directory?
    I given processing parametes queue name is TEST.
    Thanks
    srinivas
    Edited by: srinivasreddy p on May 28, 2009 8:43 AM
    Edited by: srinivasreddy p on May 28, 2009 8:52 AM

  • How to delete one existing file before uploading a file with same name?

    Hello everybody.
    I am uploading a file to Tomcat server. But, the problem is:
    i want to delete an existing file in the server, if i upload a fresh file with same name. In other words, "First check for the file with the same name in the server. If it exists, then delete existing file in the server and upload fresh one". If such file doesnot exist, then upload the file to server.
    I have given deleteonExit()
    but, for the first time when user is uploading, i want to check for the file with same name in the server.
    i am pasting the code here. please help:
    <!-- uploading the file -->
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength)
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String contextRootPath = this.getServletContext().getRealPath("/");
    contextRootPath=contextRootPath.concat("uploaded");
    String file = new String(dataBytes);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
    // Create a directory; all ancestor directories must exist
    File outputFile = new File(contextRootPath, saveFile);
    var=outputFile.getPath();
    outputFile.createNewFile();
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex + 1,contentType.length());
    int pos;
    pos = file.indexOf("filename=\"");
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream(outputFile);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    outputFile.deleteOnExit();
    %>Please help. Thanks for taking time.
    Regards,
    Ashvini

    Thank you MartinHilpert,
    I have one more doubt,
    I am uploading the file to one folder called "uploaded". Before uploading a fresh file, i want to delete all existing files in that folder. IS that possible ?? If yes, can you please tell me how to do that ??
    Regards, Thanks for your time.
    Ashlvini

  • I'm not really a computer guy.Just got a Kodak easy share camera. When I  import the photos, they go to the area with my name in a file with the date. How can I move them to iphoto, or even better, import them directly to iphoto??

    I'm not really a computer guy. I just got a Kodak"easy share" camera. When I import the photos they go to the section with my name in a folder. How do I get them from there to iphoto, or better yet, how can i import them directly to iphoto?? As stated, I'm not knowledgable,have an imac and need real rudimentary direction.

    in the iPhoto preferences be sure the action when camera is connected is open iPhoto
    What program are you using to import the photos?
    If they are in a folder you can drag that folder onto the iPhoto icon in the dock to import - our launch iPhoto and under the file menu import from that folder
    For real rudimentary directions try the iPhoto tutorials - and it would be a worthwhile investment of time to take the iphoto tutorials - http://www.apple.com/findouthow/photos/ - they are very helpful and will save you a lot of time and frustration. for the concepts - actual commands mya have shanged in some cases - and under the iPhoto help menu ==> iPhoto help - watch the videos there
    LN

  • How to delete the file with space in name

    Hi
    I want to delete the file "test ex.txt" file.
    i run the following command in command prompt.i can delete the file successfully.
    /bin/rm -f /mnt/"test ex.txt"
    I want to run the command from java.So i am using the following code
    String cmd = "/bin/rm -f /mnt/\"test ex.txt\"";
         Runtime rt = Runtime.getRuntime();
    process = rt.exec(cmd);
    The file was not deleted.
    How to delete the file with space in name?
    Help me

    Use the form of exec that takes an array of command + args.
    arr[0] = "/bin/rm"
    arr[1] = "-f"
    arr[2] = "/home/me/some directory with spaces";Or use ProcessBuilder, which is the preferred replacement for Runtime.exec, and which Runtime.exec calls.

  • There is no 'Save as' under the file menu.  How do I save a file with another name?

    Numbers help refers to the 'Save As' function in the File menu.  My version (latest) does not have a 'Save As' function.  How do I save a file with another name?

    Ross Millard wrote:
    Badunit. You have an original file and an edited file. Now you duplicate the edited file and save it with a different name. Now do you have to go and delete the changed file from which the duplicate had been made? And.... is the original still unchaned... still original?
    Ross,
    For the situation you describe, Apple has provided Duplicate and Revert. Use File > Duplicate to reach this menu:
    Regards,
    Jerry

Maybe you are looking for

  • OUAF Application Framework install question - for  Oracle Utilities SDK 4.0

    Hi, I hope someone can help me, I am really confused. I have a working install of MDM 2.1 and everything is working. Now I need to install the OUAF SDK to start coding in JAVA but since I a mstill new to all this I dont really understand where the Ap

  • Disappearing Calculated Data

    Running a worksheet in Discoverer 3.1.36 with some calculated columns that are having some very odd problems. Worksheet is a crosstab structured as follows: Orders Gross Profit Cost Mailed Net Profit Net Profit % Offer Code ### ####.## ####.## ####.#

  • Cannot start WebLogic Server 6.1 as NT Sercice

    Windows NT 4.0SP6a, WebLogic SP6.1 runs just fine from the command line. However, after installing it as NT service, the service is not able to start. I get the famous Error 2140, An internal Windows NT error occurred, if started from the services co

  • How do you close Adobe bridge for CS4?

    I have installde CS4 on a new computer, can not get it to open. While on a call to Adobe support was told to install. It will not let me with out closing Adobe Bridge to CS4.

  • Creating a "hula hoop" around someone

    I'm using CS4 on an iMac. I have a photo of a woman. I need to creat "swooshes" or "hula hoops" swooshing around her. I can't find a good tutorial that will show me how to do this. I am then cutting her out to import her into an illustrator file, so