Multiple files in different directory using single FILE adaptor

Hi Guys,
How can we handle multiple files having different format(PDF,TXT,EXCEL) and in different directory with the single FILE adaptor.
I know by using "." we ca get mutilple files, but here tthe files are of different format and in different directory.
Could you please explain as to how we can handle this scenarios?

The short answer is - "No".
The Long Question - "Why do you want to use a SINGLE channel".
If your idea is to reuse the interface then dont worry... Except for the Senderchannel and Sender agreement all your other objects can be reused ...provided your sender apter converts the different files into the same XML format..
For TXT you can use the simple file adpater..
For excel see if you can use save the file as .CSV format...then you can use it directlky by the simple FIle adapter..
For PDF use conversion agent... Here a blog to get u started on that ->
Arvind R

Similar Messages

  • How to read multiple files of different name using single file adapter

    There are two inbound locations inbound1 and inbound2 , and the files structure present in these two inbound locations are same but the files start with different names example
    (1)files in inbound1 starts with file1,file2...
    (2)files in inbound2 starts with abc1,abc2...
    by using same file adapter with read option how can i read both files....

    Hi K.A.N.N.,
    You can define multiple directories using the above link in 11g and poll for the file as \*.*.
    Alternatively you can use the Synchronous Read and specify the file name at runtime.
    You can also use Pick activity to define multiple branches each with a File Adapter to read from a specified location with specified file name. Although it would contain multiple Adapter Definitions at Development-time, only one of the Adapters will execute at Run-Time.
    Neeraj Sehgal

  • Send multiple files in different directories using Receiver File Adapter

    Hi Experts,
    I have one File to File without ESR scenario where I have to pick multiple files from different directories and to save them in different directories on receiver side.
    Can anyne help me to send multiple files in different directories using receiver file adapter.
    Is it possible??
    Any help will be appreciated.

    hi ,
    that is possiable without esr,
    we need to create one sender communication channel , in that  we nend to use "adavnced selection for source file " for sending multiple files from multiple directories.
    we need to create 'n' receiver communication channels and 'n' receiver agreements based on communication channels .
    in receiver determination, provide multiple receivers
    In interface determination , provide * symbol for receiver communication components

  • Writing to 2 different directory using file receiver channel

    I have a scenario where i am picking multiple files from one server and writing it on another. While writing the files, i want to write them to different folders using one communication channels based on the filename. is it possible? if yes how?

    You have to go for dynamic configuration UDF in the mapping.
    Refer to the below document
    Also http://****************/Tips/XI/ASMA/Index.htm
    You just need to add filters/fix value lookup and pass it to UDF to determine the target directory
    Message was edited by: Hareesh Gampa

  • Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?

    Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?
    So i have had a itunes set up on my old PC, bought a NAS and copied the folders over to the NAS, i did this incorrectly and so then even when i told the old PC to use that folder it saw all the songs but wasnt able to play the songs as it was looking in the incorrect place.
    So now i want my Mac as well as my PC and others to all use the music, videos etc on the NAS they are in itunes friendly folders (as they were compiled this way by the itunes on the old PC.
    When i tell the mac to use the itunes library.itl file it sees the song list (about 100gb) but cant see any songs, so i have removed this file to another location for now with the hope to set up a new file and then get it to see the songs on the folder from the NAS.
    Can someone tell me how to do this for all the Mac's and PC's on my network as i really want one master library that all use and add too.
    Thanks for your help in advance.

    I have the same question but I am using two pc's

  • How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap?

    How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap? Currently my program reads the data from several text files in a directory and the saves that information in a text file called output.txt. I would like to cache this data in order to use it later. How can I do this using the TreeMap Class? These are the keys,values: TreeMap The data I'd like to Cache is (date from the file, time of the file, current time).
    public class CacheData {
      public static void main(String[] args) throws IOException {
      String target_dir = "C:\\Files";
      String output = "C:\\Files\output.txt";
      File dir = new File(target_dir);
      File[] files = dir.listFiles();
      // open the Printwriter before your loop
      PrintWriter outputStream = new PrintWriter(output);
      for (File textfiles : files) {
      if (textfiles.isFile() && textfiles.getName().endsWith(".txt")) {
      BufferedReader inputStream = null;
      // close the outputstream after the loop
      try {
      inputStream = new BufferedReader(new FileReader(textfiles));
      String line;
      while ((line = inputStream.readLine()) != null) {
      // Write Content
      } finally {
      if (inputStream != null) {

    How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap? Currently my program reads the data from several text files in a directory and the saves that information in a text file called output.txt. I would like to cache this data in order to use it later. How can I do this using the TreeMap Class?
    I don't understand your question.
    If you don't know how to use TreeMap why do you think a TreeMap is the correct solution for what you want to do?
    If you are just asking how to use TreeMap then there are PLENTY of tutorials on the internet and the Java API provides the methods that area available.
    TreeMap (Java Platform SE 7 )
    Are you sure you want a map and not a tree instead?

  • Cut vedio file into different frames using java

    Hi friends,
    I would like o know how we can cut the vedio file into different formate using JMF.
    Given an input media file, the object is to cut pieces from the file and generate an output file from that.
    i want to cut vedio from X time to Y time.
    If any one is work on this please help.

    Why "split" the file? Just write a packet with a DataOutputStream(GZipOutputStream()), send it, and then read it back with a DataInputStream(GZipInputStream()) ...
    1. The GZip*Streams take care of compression.
    2. The Data*Streams take of byte order and so on.
    3. Your DatagramPacket handles the transport.
    The hardest part is figuring out what buffer size works best for your network... there is no "right" answer to that.

  • File adapter should pick a single file at a time

        I have File to RFC scenario.. in my source directory  I'm getting bunch of files with  the same name.  at a time.. but  i want to pick the one by one only. that means.. my file adapater poll interval is 30 seconds.. every 30 seconds it will pick the one file.. even though there are multiple files.. but my file adapter should pick a single file ata time..
    but at present my file adapater was picking all the files ata time..  but i want to make my file adapter should pick single file ata time..
    for this.. any special  configuration we need to do..  or  any  ideas or suggestion  .. will be.. appriciated..

    >>any special configuration we need to do..
    there is no default configuration to achieve this functionality.
    I speculate that any of this should work.
    1. Post the files to a intermediate directory and use a SCRIPT/Batch program to move only one file at a time frame to the source directory.
    2. Uncheck the option Process Read only files in the sender CC to prevent the file adapter to pick the read only files. Use a script that changes the permission of one file at a time so that the file adapter will pick that file alone.
    In both the cases the script needs to be scheduled at the OS level to run every 30 seconds.

  • Problem in reading no. of files and writing into a single file

    Iam with Problem in reading no. of files and writing into a single file....
    Iam reading no. of files stored in local directory.......
    Iam able to read and print the data in files successfully....but while writing..only first file is being written...and the next files are not written in my output file...
    plz tell me my mistake....I hope Iam doing some mistake while writing into file...PLz help.....
    Basically my code structure is like this....
    import java.util.regex.*;
    import java.util.*;
    import java.text.*;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    class Writing {
    public static void main(String args[]) throws Exception {
              FileOutputStream fileOut = new FileOutputStream("ServerResult.xls"); //my output file
              int counter = 1;
              File dir = new File("C:/Perform/ServerLogs");
              String[] children = dir.list();
              if( children == null)
                   System.out.println("The Directory mentioned does not exist");
              else {
                   for (int fileNo = 0; fileNo < children.length; fileNo++ ) {        //Files iteration starts
                        String filename = children[fileNo];
              File logFile = new File(filename);
    FileReader logFileReader = new FileReader(logFile);
    BufferedReader logReader = new BufferedReader(logFileReader);
    StringBuffer sBuf = new StringBuffer(5000);
              HSSFWorkbook wb = new HSSFWorkbook();          
              HSSFSheet sheet = wb.createSheet();
              HSSFRow rowTitle;
              HSSFRow rowReq;
              HSSFRow rowRes;
    String aLine = null;
    boolean skip = false;
    boolean readed = false;
    boolean initReq = false;
              boolean flag = false;
    long requestTime = 0;
    long responseTime = 0;
    long recdTime = 0;
    long sentTime = 0;
              long hasTime = 0;
              long presentTime = 0;
              int hasCalls = 0;
    Pattern startMessage = Pattern.compile("^<MESSAGE.*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    Pattern requestMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"RequestMsg.\".*ID=\".*_"+args[0]+"\".*<ActName>(.*)</ActName>.*", Pattern.DOTALL);
    Pattern requestMessage1 = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"RequestMsg.\".*ID=\".*_"+args[0]+"\".*<Svc id=\"(.*)\">.*", Pattern.DOTALL);
    Pattern responseMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    Pattern initMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"HostConnInit\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    Pattern initResMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\"null\".*", Pattern.DOTALL);
    Pattern initResIDMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"ResponseMsg\".*ID=\"null\".*<IATA>"+args[0]+"</IATA>.*", Pattern.DOTALL);
              Pattern sentMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"DCMsgSentInfo\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
              Pattern rcvdMessage = Pattern.compile("^<MESSAGE.*TS=\"(.*)\" CATEGORY=\"DCMsgRcvdInfo\".*ID=\".*_"+args[0]+"\".*", Pattern.DOTALL);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    DecimalFormat dcf = new DecimalFormat("########.##");
    String actName = "";
              if (fileNo ==0)
              rowTitle = sheet.createRow((short)0);
              rowTitle.createCell((short)2).setCellValue("Server Time(in ms)");
              rowTitle.createCell((short)3).setCellValue("Request Vs Response Time in Server(in ms)");
              rowTitle.createCell((short)4).setCellValue("Time Taken By HAS/HOST(in ms)");
              rowTitle.createCell((short)5).setCellValue("No. of HAS calls");
              rowTitle.createCell((short)6).setCellValue("Data Size");
    while((aLine=logReader.readLine()) != null) {
    if(aLine.startsWith("<MESSAGE TYPE=\"EVENT\"")) {
    Matcher m = startMessage.matcher(aLine);
    if(m.find()) {
    skip = false;
    initReq = false;
    m = initMessage.matcher(aLine);
    if(m.find()) {
    initReq = true;
    } else {
    if(initReq) {
    m = initResMessage.matcher(aLine);
    if(m.find()) {
    skip = false;
    } else if(aLine.startsWith("</MESSAGE>")) {
    if(!skip) {
    readed = true;
    } else if(!skip){
    if(!skip && readed) {
    String tempStr = sBuf.toString();
    if(tempStr.length() > 0) {
    boolean reqMatched = false;
    Matcher m = null;
    if(initReq) {
    m = initMessage.matcher(tempStr);
    actName = "Intialization";
    } else {
    m = requestMessage.matcher(tempStr);
    String time = "";
    if(m.find()) {
    reqMatched = true;
    for (int i=1; i<=m.groupCount(); i++) {
    String groupStr =;
    if(i == 1) {
    time = groupStr;
    } else if(i == 2) {
    actName = groupStr;
    } else if(!initReq){
    m = requestMessage1.matcher(tempStr);
    if(m.find()) {
    reqMatched = true;
    for (int i=1; i<=m.groupCount(); i++) {
    String groupStr =;
    if(i == 1) {
    time = groupStr;
    } else if(i == 2) {
    actName = groupStr;
    if(time.length() > 0 ) {
    requestTime = sdf.parse(time).getTime();
    }catch(Exception ex){}
                                  String reqDataSize = dcf.format(((double)time.length()/1024.0))+"K" ;
                                  rowReq = sheet.createRow((short)counter);
                                       counter = counter +1;
                                       System.out.println("counter is "+counter);
                             Matcher l = sentMessage.matcher(tempStr);
                             Matcher k = rcvdMessage.matcher(tempStr);
                   if(l.find()) {
                                            for (int i=1; i<=l.groupCount(); i++) {
         String groupStr2 =;
    sentTime = sdf.parse(groupStr2).getTime();
    }catch(Exception ex){}
                                                 for(int j=1;j<=k.groupCount(); j++) {
                                                 String groupStr1 =;
    recdTime = sdf.parse(groupStr1).getTime();
    }catch(Exception ex){}
                                                 presentTime = (recdTime - sentTime);
                                                 hasTime = hasTime + presentTime;
                                                 hasCalls = hasCalls +1;
    if(!reqMatched) {
    if(initReq) {
    } else {
    if(m.find()) {
    for (int i=1; i<=m.groupCount(); i++) {
    String groupStr =;
    responseTime = sdf.parse(groupStr).getTime();
    }catch(Exception ex){}
                                                 String resDataSize = dcf.format(((double)tempStr.length()/1024.0))+"K" ;
                                                 rowRes = sheet.createRow((short)(counter));
                                                 rowRes.createCell((short)3).setCellValue((responseTime - requestTime));
                                                 hasTime = 0;
                                                 hasCalls = 0;
                                                 counter = counter + 1 ;
    readed = false;
              } // End of for (int fileNo = 0; fileNo < children.length; fileNo++ )
    }     //End of else
    } //End of public static void main
    } // End of Class

    First of all, use [code]-tags to make your code readable, please.
    I didn't do a complete inspection of your code (because it's too much and unreadable as it is) and I don't know POI, but creating a new HSSFWorkbook for each input file sounds fishy to me ... try re-using the workbook and just creating a new sheet in each iteration.

  • How to process files one by one using sender file adapter

    I have to process file one by one using my file adapter (sender), because while doing the G/R materials get locked, if the same materal exist in other files.
    I have maintained QOS as "Exactly Once in Order" & processing Sequence as "by date".
    Processing sequence come in which tab? What will be the Queue name?

    It will come under Processing tab
    Here you need to select the first parameter QOS  as EOIO
    Then QUEUE name and processing sequence will be enabled.
    NOTE: This will work only for NFS protocol not for FTP.

  • Accessing multiple directories using single file adapter

    Hi All,
              I have data coming from two banks. I need to put them in SAP file server. Now i have two sender adapters for each bank, now is there a way i can use same receiver adapter but create diff directories to store them.

    In file sender communication channel there is a check box for Advanced Selection for Source file. Check that and you dont put anything in exclusion which means it takes all the files from multiple direcotires. Please check this weblog where he has excluded some files in the directory. But you dont need to exclude anything.

  • How to check files in the directory using JSP?.

    How can i check the file is directory or file and readable or writable and file size and type of file(Ex. jpg, txt, doc., etc). i want to list the specific type of file in the particular directroy.. please help me..

    With the File class, using the methods isFile(), isDirectory(), canRead(), canWrite(), length() and getName()
    With File.listFiles() you can get a directory listing. If you want to limit the amount of files returned, you can pass your own FileFilter to it.

  • File length different for a copied file. Or use checksum

    I am making a backup of a file before doing some writes to the original.
    I first check it out of source control, then make a copy using:
    public static void backupFile(File f)
    File backup = new File(f.getPath()+"_BACKUP");
    if (!backup.exists()) {
    if (!backup.createNewFile()) {
    Logger.getLogger().log("Could not create "+backup.getPath());
    } catch (Exception e)
    Logger.getLogger().log("Error backing up "+f.getPath()+ ": "+e);
    public static synchronized void copyFile(File from, File to) throws Exception
    if (!from.exists() || !from.isFile())
    throw new Exception ("copyFile Error: checking 'from' file!");
    if (!to.exists())
    throw new Exception ("copyFile Error: creating 'to' file!");
    FileInputStream in=new FileInputStream(from);
    FileOutputStream out=new FileOutputStream(to);
    int length;
    byte[] buffer=new byte[256];
    while((!=-1) {       
    out.write(buffer, 0, length);
    After writing has finished, I need to see if the file is different to the backup..
    If so, I need to check it into source control.
    I wanted to use a checksum, but couldn't find an example that actually worked!!! Therefore I did a quick tool:
    public static boolean isBackupIdenticalToOrig(File f) throws Exception {
    File bu = new File(f.getPath()+"_BACKUP");
    Logger.getLogger().log("Lengths: New/Backup"+f.length()+"/"+bu.length());
    if (bu.length()!=f.length())
    return false;
    // Have the same lengths, so we can compare!!
    BufferedInputStream f_in = null;
    BufferedInputStream bu_in= null;
    f_in =new BufferedInputStream (new FileInputStream (f));
    bu_in =new BufferedInputStream (new FileInputStream (bu));
    for (int i=0;i<f.length();i++)
    int c =;
    int d =;
    if (c!=d)
    Logger.getLogger().log(""+f.getName()+" has been modified");
    return false;
    Logger.getLogger().log(""+f.getName()+" has not been modified");
    return true;
    The problem is in that the File.length() method is returning different values for the backup file, than for the original, even if identical!
    For example:
    10/15/2002 10:22:05: Lengths: New/Backup413/402
    10/15/2002 10:22:06: Lengths: New/Backup397/386
    10/15/2002 10:22:07: Lengths: New/Backup191/185
    All the new files are longer that the backup, but the contents are exactly the same! Is there some WIN32 'extras' in the file that's causing a problem here???
    In each of the cases, if I open the new(Longer) file in a good editor, I can see that the lengths are correct. But no extra characters existed in the new file compared to the backup!!
    Any ideas would be most appreciated

    10 and 13 are CR(carriage return) and LF(linefeed) - this is normal for a Windows file. Use this copy routine; it works.
       // copyFile -  input: inFile -  path to source file
       //                    outFile - path to copy file to (including filename)
       //                    bRemoveSource - true removes the source files, false leaves them intact
       //             returns: void
       public static void copyFile(String inFile, String outFile,boolean bRemoveSource) throws IOException
          FileInputStream fin     = null;
          FileOutputStream fout   = null;
          boolean bCanWrite       = false;
          boolean bDeleted        = false;
          // To preserve date/time stamp
          File fTimeIn = new File(inFile);
          File fTimeOut = new File(outFile);
          long lTimeIn = fTimeIn.lastModified();
            fin  = new FileInputStream(inFile);
            fout = new FileOutputStream(outFile);
            copyStream(fin, fout);
              if (fin != null) fin.close();
            catch (IOException e) {}
              if (fout != null) fout.close();
            catch (IOException e) {}
          // Set out time to in time
          if (bRemoveSource == true)
             bCanWrite = fTimeIn.canWrite();
             if (bCanWrite)  {
                bDeleted = fTimeIn.delete();
       // copyStream (a helper function for copyFile) -  input: in  - file stream of source file
       //                                                       out - file stream of destination file
       //                                                returns: void
       // *** NOTE: This function is thread safe ***
       public static void copyStream(InputStream in, OutputStream out)  throws IOException
          // do not allow other threads to read from the
          // input or write to the output while copying is
          // taking place
          synchronized (in)  {
             synchronized (out)  {
                byte[] buffer = new byte[256];
                while (true)  {
                   int bytesRead =;
                   if (bytesRead == -1)
                   out.write(buffer, 0, bytesRead);

  • How to add users/entry in the oracle internet directory using XML file

    hi friends,
    i need to know how to add entries, attributes in the oracle internet directory using the XML file.

    I could able to execute the ldapadd command with out error as
    ldapadd -h -p 389 -D "cn=orcladmin" -w password -X mypath/filename.xml
    but the data entry is not added in OID. can any one help me out.

  • Unable to Receive the File into Target Directory Using FTP

    Hi All,
    Here I Did Simple File-File Scenario With FTP.
    Iam Able to Pick the File From the FTP Location And File has been Deleted From Source Location ( Set the Processing Mode as Delete ).
    Unable to See the Pipeline Steps in Moni, But Able to Se the Success Message With the Inbound Payload only.
    Also chked with the comm. channel of sender and receiver, where the sender shows the message process details but not the receiver comm. channel.

    You Did the right thing in communication channel that u selected the IS.
    Just check out if you sending the correct parameters and also check out the payload you sending and check out in SXMB_MONI for you message that after success wat is the payload and match with your input.
    Rather, for input check, In IR, get the XML data from ur Message Mapping and then save it to your inbox that is input directory.
    Also check out the permission of Output directory and also check the configuration of sender and reciver communication channel.
    Aashish Sinha
    PS : reward points if helpful

Maybe you are looking for

  • Preview keeps adjusting my text boxes

    Hi, So i open up a PDF in preview and want to add some text so i add a text box and adust the size to fit my text. All good at this stage but then if i save it and close and then re open the text is still there in the text boxes but they have been sh

  • ITunes showing playlist but they aren't on my phone

    When I have my phone plugged into iTunes it shows a lot of playlist but on my phone I only have one playlist that I created on my phone. I can't add any playlist to myphone from imy computer and I can't drag and drop songs onto my phone! Any suggesti

  • Embedding html for use in a tilelist

    In my app I have several images which I've defined as public vars like this:- Bindable][ Embed(source="assets/images/skynews_small.png")]  public var image10:Class; These images are then contained within an array collection which serves as a dataprov

  • Regarding alv tree output

    Hi all,           I am working in oops alv tree.            i have written the code i m getting the tree i.e frst output, but when i am try to get the second one i m not able. frnds below i m giving my code plz suggest wht is my mistake. <code> REPOR

  • MacBook Pro will not shutdown with external HD Screen

    I have been working with the same configuration for over a year with no problems. I have an external 20" HD screen that I use with my MacBook Pro (cover of mbp is closed not dual screen use) and an external keyboard and mighty mouse. Ever since upgra