Pick a file based upon its extension

Hi Experts,
I have a requirment. I have to pick a file based upon its extension, i.e., the file having a particular extension, should be picked up before fiiles having a diferent extension.
Is this possible using only the adapter configuration?
Thanks and Regards,
Sanjeev.

Hi Sanjeev ,
Have a look at following PDF .These will be helpful to create your Road map
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4f61fddf-0601-0010-7ab5-fb749538f6ab
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d458a870-0601-0010-caab-b99c79741964
/people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
BPM Steps..
http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/frameset.htm
/people/shabarish.vijayakumar/blog/2006/11/26/adapter-scheduling--hail-sp-19-
Reward points if it is useful
Thanks
Sunil Singh

Similar Messages

  • Group the files based on their extensions

    Hi,
    I am traversing a dir and listing all the files under that directory. Now i want to group the files based on the extension and just print the number of files with each extension.
    ex:
    Extension No.of Files Size of the files
    .java 10 23455 bytes
    .html 2 1000 bytes
    I am able to get the extension of the files. I would like to know how to proceed after that.
    Any sample code will be helpful.
    Regards
    Kutty

    I have used a method to list all the files in the directory. After adding files with same extension to the HashMap. i am printing files after reading file by file. I need to print the files once i complete reading all the files in the directory.
    Any suggestions?
    private void listingFiles(File f )
              Map extensionMap = null;
              File[] files = f.listFiles();
              for( int i = 0; i < files.length; i++ )
                   File file1 = files;
                   Dprop.size += files[i].length();
                   if (file1.isFile())
                        fcount = fcount +1;     
                        if (extensionMap == null)
                             extensionMap = new HashMap();
                             // Group files by extension
                             for(int idx = 0; idx < files.length; idx++)
                                  if (files[idx].isFile() && files[idx] != null)
                                       String ext = getExtension(files[idx]); // get the extension
                                       ext = ext.toLowerCase();
                                       List fileList = (List)extensionMap.get(ext);
                                       if(fileList == null)
                                       fileList = new ArrayList();
                                       extensionMap.put(ext, fileList);
                                       fileList.add(files[idx]);
                        // Access all the files by extension
                             for(Iterator extensionIterator = extensionMap.keySet().iterator(); extensionIterator.hasNext(); )
                                  String ext = (String)extensionIterator.next();
                                  List fileList = (List)extensionMap.get(ext);
                                  System.out.println("\n\nNo of Files "+fileList.size()+" with extension '"+ext+"' in '"+f+ "' Directory");
                                  for(Iterator fileIterator = fileList.iterator(); fileIterator.hasNext(); )
                                       File file = (File)fileIterator.next();
                                  System.out.println("File Name "+file+" File Size "+file.length());
                   else
                        dcount = dcount +1;
                        listingFiles( file1 );
    Thanks in advance
    Kutty

  • Pick up Files based on Timestamp???.

    HI All,
    Is it possible to pick up the files in the order of which they are put in a shared folder ?.
    Our client system will put the xml files in a shared folder with timestamps..PI will pick these files one by one..but if the PI server is down.. the files will keep coming in the shared folder from the client system..and when PI come back up they need to be picked in the order in which they have been put according to timestamp.
    I'am using the NFS functionality.
    I dont want to output files from PI based on timestamp added.. I want to pick files up based upon sender timestamp.
    Is this funcationality supported in PI?.
    Thanks.

    HI
    You can write script to do this. Script can copy files based on time stamp from the folder where client system is putting the file to the folder PI is poling based on timestamp.
    With this as Ratan said. If the file creation date for file system is in date and time format(timestamp) File processing sequence by Date can help. It process file starting from oldest file.
    Thanks
    Gaurav

  • How to pick the file which is created with current date

    Hello All,
    I have an FTP server where files are created with current date as PO_CONFIRM_20100701.txt.
    Need to pick the file based on current date. How to pick the above file format using file sender adapter. i.e what file pattern can we use so that file will be picked only on today's date
    Regards,
    Sreenivas.

    Hi Srinivas,
    It depends upon the OS you are using. If unix you can see an example script here:
    http://www.computing.net/answers/dos/batch-file-to-rename-files-by-date/5517.html
    If windows an example here:
    http://en.kioskea.net/forum/affich-87157-finding-and-using-file-date-in-batch-command
    You may need to change slightly to fit your exact requirements. But this would make you to start. Else you can also google to get the script. Here is one link:
    http://www.google.com/#hl=en&source=hp&q=scripttorenamefileshavingtodaysdate&aq=f&aqi=m1&aql=&oq=&gs_rfai=CRE9SwTMsTNjiDpzGhgTm65iFCwAAAKoEBU_QC2i-&fp=e0fa4b5da4f245a4
    Regards,
    ---Satish

  • Sorting files based on type

    So I wanted to make an automator that watches a folder and when a file is added it should quickly sort it into one of my other foldrs based on its extension.so if its a pdf it should go into folder "pdf".
    I thought I could be smart and instead of making a workflow for each filetype I can have automator find the extension and move the file into that extension folder.
    i thought I could call an apple script that will return the extension name.
    Im having trouble it wont work passed the applscript step
    ....anyone know what I can do?
    i pass the file into my applescript:
    on run {input, var1}
    set var1 to (get name extension of file "input")
    return var1
    end run
    and it says it cant get input?
    Message was edited by: shamguy4

    In the *Run AppleScript* action's run handler statement:on run {input, parameters}
    the input parameter variable is a list of the items passed to the action, and the parameters parameter variable is a list of the parameters of the *Run AppleScript* action itself (the action's user interface - e.g. the source text of the script, if it ignores input, etc). Typically you just loop through the input list:on run {input, parameters}
    repeat with anItem in the input
    -- do something with the item
    end repeat
    return input -- or return the results of your script (for the next action)
    end run

  • Show or Hide fields based upon a variable value

    Hi,
    I am a rookie in the field of Acrobat. And my only question is :
    How to Circle a Form Field based upon a variable value .
    For example, If x=1, I want to circle Japan and if x=0, I want to leave it without any change.
    Please help me out. Thanks for your time and help.
    Thanks,
    Vijayvijay77.

    Hi George,
    I am pre-populating a Pdf file based upon the data submitted by the user. And I have to circle options selected in the form.
    I am writing coldfusion code to flatten, populate the form into a PDF form. The end result is the PDF generation with all the data in it.
    The data comes from the database, where I set variable values if any is selected or not.
    Thanks for your reply, I really appreciate your help.
    Vijayvijay77.

  • Sender File adapter not picking the file ABCD.PRN extension file

    Hi
    Am doing File to Abap Proxy scenario. My source will be in text format of fixed length of fileds 7.
    My souce file will be generated by a third party machine with the extension EEE150809.PRN. In my scenario my file adapter should pick the file and update the same in ECC via a Proxy.
    I have configured the Sender File adapter with Message Protocol -  Content Conversion but file adapter is not picking the file. I have checked the Communication channel and status is fine. But the same Communication Channel works for .XML file.
    What are the parameters that I have to consider with the file extension .PRN using File adapter?
    Thanks.
    S.

    Hi Swarna,
    You dont need to worry about the extension when picking the file. You can try using EEE* so that is picks all the files starting with EEE. If you have the fixed name then you can try giving EEE150809.*. Also EEE150809.PRN should not have any issue. Try to see in sender commu ication cahnnel for anyerrors. Probably there might be some network issues or authorisation issues. If you are reading with NFS then ask them to give necessary permissions. If you are reading through FTP check the user id and pwd you are using.
    Regards,
    ---Satish

  • Picking files based on the requested URL

    Hi Experts
    I have a requirement where I need to pick image files from SAP DMS server based on the URL requested.
    The scenario :
    Third-party sends a URL  corresponding to a particular image in DMS as request and PI needs to Pick the image
    file and send it as response.
    Due we need BPM? How to set up sender file adapter source directory as  the file name/directory   to be picked is dynamic in nature and there is no specifc pattern .We need to pick the exact file base on the Unique URL.
    Can we do this requirement in a synchronous interface by using HTTP or SOAP attachments for image? What about
    the performance impact as we have img files here.
    Regards,
    Srinivas
    Edited by: Srinivas on Sep 27, 2010 11:36 AM

    Third-party sends a URL corresponding to a particular image in DMS as request and PI needs to Pick the image
    file and send it as response.
    BPM would be required....We had a similar requirement wherein a URL was given at runtime to PI....then PI had to call the location and get back the details and we used SOAP for this (SYNC Call to the URL using SOAP channel from the BPM).
    Can we do this requirement in a synchronous interface by using HTTP or SOAP attachments for image?
    Not sure how the attachment will function inside a BPM....in my case I got the details as part of the message...even it was an image but it was stored as a base64 encoded message.
    Regards,
    Abhishek.

  • Sender File adpater to Pick Two files at a time based on the file name

    Hi Everyone,
    I have a scenario where I need to pick two files at a time using file adapter where the two files names have a common string in between their names.For example , the file names can be sets like
    H123.txt and L123.txt
    H345.txt and L345.txt.
    Now how do we handle this in the File Adapter ?

    Anu,
    Two approaches.
    1.     Use BPM: use a collect pattern to pick those files: L and H files , use multi mapping to merge those files and map to IDoc. Constraint is that there must be a mandatory correlation field in both the files. Say a same po id  in L and H file.
    2.     Use an Adapter module with additional files option in file Adapter. Operate on the Main payload and attachment inside your module code to get a combined contents of both files and proceed.
    Module is preferable in terms of performance, but maintenance is difficult. Deployment after each changes, transport issues, etc.
    BPM is resource intensive, but easy to maintain, transport.
    Choose based on your requirement.
    Regards,
    Sudharshan N A

  • How to pick the multiples based on file size

    Hi All,
    my sender file adapter needs to pick up 5 files based on file size.
    for example 1file size is 500kb,2nd file size 300kb,3rd file size 400kb, 4file size 100kb and 5file size 600kb.
    here my requirement is, my file adapter needs to pick in the below order like 5th file,1st file,3rd file 2nd file and 4th file.
    means based on file size, i need to pick up my file adapter.
    could you please ang inputs on this requirement.
    Thanks & Regards,
    AVR

    Hi AVR,
    for case 2:
    1. At specific time each day  "23:58:00" hours ,count the number of files in directory say "c:\apps\acm".
    2. sort the files on basis of their size.
    3. place the files one by one after definite  time interval (more than polling time of the sender communication channel).
    in target directory say "c:\apps\acm1" from where PI server  picks up the files for further processing. The file with smallest size is placed last.
    4. In this case you need to ensure all files are present in the directory "c:\apps\acm" before "23:58:00" hours.
    for case 2  java code
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class sortFilesOnSpecificTime {
    * @param args
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try
    * In Unix/Linux OS, dir1="/usr/apps/test"  etc
    int pollingInterval=10,sleepTime=1*60;
    String dir1="c:\\apps\\acm";
    String dir2="c:\\apps\\acm1";
    File fread=new File(dir1);
    File fwrite=new File(dir2);
    if(fread.canRead()==false)
    System.out.println("error: "+dir1+" does not have read permission. Program Terminates.");
    return;
    if(fwrite.canWrite()==false)
    System.out.println("error: "+dir2+" does not have write permission. Program Terminates.");
    return;
    String fileNames[],fileNamesOut[];
    long fileSize[];
    int i,j;
    byte b[];
    int t=4;
    Calendar cal;
    int hour24,min,fileCopyHour=23,fileCopyMin=58;
    long waitSeconds=1,currentTime=0;
    while(t>0)
    cal = new GregorianCalendar();
    hour24 = cal.get(Calendar.HOUR_OF_DAY);     // 0..23
    min = cal.get(Calendar.MINUTE);             //0..59
    System.out.println("current time="+hour24+":"+min);
    /*loop unless time reaches a specific predetermined value
    * predetermined values are provided by values
    * fileCopyHour=8,fileCopyMin=30 i.e say 08:30 hours
    currentTime=(hour24*60+min)*60;
    waitSeconds=(fileCopyHour*60+fileCopyMin)*60 - currentTime;
    if(waitSeconds>0)
    * in case you wanna to make this thread sleep for
    * say sleepTime(10) minutes before it checks the files once again
    * because looping continuously causes wastage of CPU cycles.   
    Thread.sleep(waitSeconds*1000);
    //read list of files
    fileNames=fread.list();
    if(fileNames.length;=0)
    * time is up but there are no file
    * in dir1 to copy. Then this program
    * goes to sleep for some time and
    * checks only at 11:55 hours. That is
    * end of the day
    continue;
    fileSize=new long[fileNames.length];
    fileNamesOut=new String[fileNames.length];
    //read their sizes
    for(i=0;i<fileNames.length;++i)
    fileNamesOut<i>=fileNames<i>;
    fileNames<i>=dir1+System.getProperty("file.separator";)+fileNames<i>;
    fileSize<i>=new File(fileNames<i>).length();
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    //sorting on basis of file size descending order
    long value;
    String temp;
    for(i=1;i<fileSize.length;++i)
    value=fileSize<i>;
    temp=fileNames<i>;
    for(j=i-1;j>=0 && fileSize[j]<value;--j)
    fileSize[j+1]=fileSize[j];
    fileNames[j+1]=fileNames[j];
    fileSize[j+1]=value;
    fileNames[j+1]=temp;
    //now copy files to dir2
    b=new byte[512];
    for(i=0;i<fileNames.length;++i)
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    for(i=0;i<fileNames.length;++i)
    File f=new File(fileNames<i>);
    FileInputStream in=new FileInputStream(f);
    FileOutputStream out=new FileOutputStream(dir2+System.getProperty("file.separator";)+fileNamesOut<i>);
    int len=0;
    while(2>1)
    if((len=in.read(b))<0)
    break;
    out.write(b,0,len);
    in.close();
    //delete files after copying from dir1
    f.delete();
    out.close();
    //put each file after polling interval is over
    Thread.sleep(pollingInterval*1000);
    catch(Exception e)
    e.printStackTrace();
    The code runs in infinite loop. You need to run them in command line in DOS environment as you indicated that you OS is WIN XP.  I have a few print statements which I kept for debugging, you can safely remove them and run the codes. This code is independent of the Operating System you are using. Only change is required in values of "dir1","dir2", timings and file count, which I think you can take care easily.
    Hope this solves your problem.
    regards
    Anupam

  • Bought a new camera and Photoshop advises me that it can not read my type of file.. Its canon 7d mark 2 and the extension is CR2.

    Bought a new camera and Photoshop advises me that it can not read my type of file.. Its canon 7d mark 2 and the extension is CR2.

    Hi EddieGerdak,
    The update is available now.
    Release details:
    Lightroom 5.7: http://blogs.adobe.com/lightroomjournal/2014/11/lightroom-5-7-now-available.html
    Camera Raw 5.7: http://blogs.adobe.com/lightroomjournal/2014/11/camera-raw-8-7-and-dng-converter-8-7-now-a vailable.html
    Regards,
    Pete

  • Vbscript delete files based on extension on a drive

    Right now i use this batch script to delete files based on extension on drive D: and all folder and subfolder on it every computer restart.
    @echo off
    del /F /S /Q D:\*.jpg            
    del /F /S /Q D:\*.mp3
    del /F /S /Q D:\*.lnk
    del /F /S /Q D:\*.bmp
    I need to change that batch script in to vbscript with same function.
    Help me please..
    sorry for my english..

    righ now i used batch file on startup windows xp, but i want to use vbscript because the cmd will be disable on plan. my batch script like this.
    As mentioned in your duplicated thread, respondents in this forum will gladly help posters with their script problems but they do not write scripts on demand. Here are a couple of options for you:
    Learn how to write VBScripts or PowerShell.
    Run the job as a scheduled task at boot time under an account other than the logon account.

  • Assign the name of a file and its extension when using DESTYPE=MAIL

    Hello,
    I've developed a report running Oracle Reports 10g that is being emailed to a user. I would like to specify the name of the file and it's extension that is attached. Are there variables or parameters in Oracle Reports that I can use to accomplish this?
    It looks like by default that the file name is using the Name value found in the Property Inspector for the report. I have not been able to find a way to re-assign this value with a value from either the input or select values in the data model.
    Will Oracle Reports 10g allow me to define the name of the file and the extension?
    Any help or direction would be greatly appreciated.
    Thanks in advance
    Jesse
    Message was edited by:
    Sutherland

    Thank you for the quick reply and information. I almost thought you had solved my problem until I found out that distribution and bursting do not support delimited and spreadsheet output. One of the two files I need to email has a desformat of SPREADSHEET.
    Is there any other way to manipulate the file name and extension when using destype of MAIL?

  • File based event not triggering

    We are facing issue in file based event  scheduling.
    Files are getting created on the server path.But the event server is not  trigerring the event upon file creation.
    File Path is also correct.
    I checked the event server metrics ,In List of Monitored files,Last Notified Time is blank.
    This was all working fine since last 3 months.
    Recently we had some antivirus upgrades on server,after that this problem has started.
    I can read write and create files on the server path.But event is not getting fired.
    Server Details
    BO 3.1 FP 3.5
    Edited by: Rizwan Aamir on May 14, 2011 1:39 PM
    Edited by: Rizwan Aamir on May 14, 2011 1:40 PM

    I checked abot the userID used to restart SIA from Server Team.
    They Said the userid is not a NT id its a BO user ID Admininistrator account .
    Is it True that LoginID used to restart the SIA is a BO User ID and not a NT login ID.

  • Edge Transport Attachment stripping based upon an emails Subject line.

    I am running Exchange 2010 on-prem with a 2013 Hybrid (including a 2013 Edge Transport server for message handling between on-prem and the o365 tenant) connecting to an o365 tenant. I use EMC's SourceOne for archiving running on-prem. The o365
    tenant points to a mailbox on my on-prem Journaling server.
    What I am seeing is that when o365 forwards emails as attachments from the cloud back to the on-prem Journaling server it is examining the subject line of the message and making a decision to strip the attachment based upon the very end of the subject line.
    Example: A simple text message with a subject line of: "Check out the new web site at www.xyz.com"
    The Edge transport server is seeing this as being a ".com" attachment and stripping it off before it gets to the Journaling server. So it does not appear to be looking inside the message to see what it actually is and figure out that it is not
    a ".com" file but a simple text message.
    I have seen this with other file extension types as well. Such as ".exe" . It is also stripping off ".zip" attachments as well, but I understand that and not sure how to deal with it.
    Has anyone else experienced this and how have you dealt with it? Microsoft wants me to take the Edge out of play and go directly to from the cloud to an on-prem Exchange server. But that is not an option as the on-prem servers are not exposed to the internet.
    Thanks, Bob
     

    Hi BobSwe,
    Thank you for your response.
    If you have resolved this question, please mark useful replies as answer.
    Thanks,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Allen Wang
    TechNet Community Support

Maybe you are looking for

  • How to password protect apple mac book

    how to password protect macbook pro

  • Java on iPhone 3GS

    I need JAVA on my Iphone... My iMax runs JAVA without any problems but I cant install Java on my iPhone... Can anybody help.....

  • Unable to install Oracle Migration Assistant for Access

    I download Oracle Migration Assistant for Microsoft Access from the web but I can't install it on windows NT. Oracle Installer want a file nt.prd but I have a file product.jar. What is the solution? Thanks. Sylvain Denis null

  • Cisco 6800 SSO configuration

    Hi All, I am trying to find the guide on how to configure the SSO for the two supervisor engines. I am trying to recall if secondary ip addresses were required for the secondary supervisor for the SSO to work. Can someone guide me on this?

  • Change XPMode User name

    Is it possible to change the default username for XPMode on a windows 7 machine. The default is XPMUser, can this be changed. Reason is we have an application automatically user the current logged on user to authenticate. Mike K.