How to read the files in different directories

how to read the files in different directories here directory names will change dynamically under root node.
let me say
rootnode---->subnode1
>subnode2
>subnode3
>subnode n
how to specify these in file adapter.

Hi
look at this thread your problem is solved here
File Adapter
Regards
Abhishek
Edited by: Abhishek Agrahari on Dec 16, 2008 11:37 AM

Similar Messages

  • How to include header files from different directories?

    Hi,
    Sorry for the newb question, but I can't figure this out. I'm trying to compile a simple piece of code (C++) that uses header files in a directory different from the Project directory; header files are in /opt/csw/postgresql/include/pqxx. I've tried a few different things, adding that directory to the include directives under Resource Files, add existing files from a folder, etc etc. Whenever I try to build, dmake bails with status -1. I can't seem to get this working, can someone explain how to use header files from different directories?
    Thanks,
    SlowToady

    Header files are usually specified relative to a base directory. If the base directory is not a system directory -- /usr/include or the compiler installation directory -- add a command-line directive
    -I path/to/base/dirfor each such directory.
    The path can be absolute, such as
    -i /opt/csw/postgresql/includeor relative, such as
    -I ../../my/includeIn your source code, specify the header file relative to the base directory, and be sure to use quotes, not angle brackets. Example:
    #include "header.h"  // right
    #include <header.h>  // wrongThe angle brackets are used for system headers, like <iostream> or <stdlib.h>.
    The rules above are common to all compilers on Unix and Linux, and generally to all C and C++ compilers.
    For more details, read about the -I option in the C++ Users Guide. You can find the guide by pointing your browser to the "docs" directory in the compiler installation, or go here:
    http://docs.sun.com/app/docs/doc/819-5267
    All command-line options are described in Appendix A.

  • How to read the file from a folder.

    Hi All,
    How to read the file from a folder or directory from the non sap server / remote server.
    Regards
    Sathis

    open dataset filename for input in text mode
                         encoding default.
    filename is character type variable with the destination filename.
    Edited by: Jino Augustine on Apr 19, 2010 1:31 PM

  • Drop the files into different directories based on the filename

    Hi,
    I had a reqiuirement based on the file name, i should drop the files in to different directories.
    I can get the filename through variable substitution in receiver file communication channel, now i want to drop the file into different folders based on conditions.
    suppose, if the file name is DDDX234
    i should do substring of filename0+(4), if the value is L then i should drop in X directory
    suppose, if the file name is DDDY234
    i should do substring of filename0+(4), if the value is L then i should drop in Y directory.
    How can i drop the file into differnent directories based on filename.
    Thanks
    Srinivas

    Thanks Michal,
    I mapped the directory and filename to the target header in the mapping
    Filename --> UDF --> Header(target)
    and in the receiver channel checked the ASMA and given * in the filename and directory name.
    But in runtime iam getting the error as
    Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    MY UDF is
    public String Directory(String a,Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key  = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
    String FileName = conf.get(key);
    FileName = a;
    conf.put(key, FileName);
    %%%based on filename the directory should change
    String Directory = conf.get(key1);
    Directory = "/SAPInterface/XI/PPD/DHX/out";
    conf.put(key1, Directory);
    return "";
    Help me in correcting this error.
    Thanks
    Srinivas

  • How to read the file from ftp server

    Hi
    I need to read a file from a ftp server . Iam using apache lib common-net .jar .
    FTPClient ftp = new FTPClient();
    ftp.connect(server);
    ftp.login(username,password);
    FTPFile[] files = ftp.listFiles();
    for(int i=0 ;i<files.length;i++){
    System.out.println(" File : "+ i + " - " + files);     
    InputStream ip = ftp.retrieveFileStream(path);
    I got the inputstream from the ftp server. but iam not able to read the contents of the file ....
    help me plzzzzz

    Hi
    I have one more problem . first i try to read the file and write the file in local directory . then i try to read the data in the remote file .. iam getting the datas as null.
    InputStream ip = ftp.retrieveFileStream(path);                    
    File f = new File("D:\\ftp.txt");                    
    FileOutputStream fo = new FileOutputStream(f);
    byte[] buf = new byte[1024];
    while ((len = ip.read(buf)) > 0) {                         
    fo.write(buf,0,len);               
    fo.close();
    BufferedReader br = new BufferedReader(new InputStreamReader(ip));
    String line;
    do {
    line = br.readLine();
    System.out.println(" data " +line);
    }while (line != null);

  • 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.
    Regards,
    Neeraj Sehgal

  • How to search the file in all directories

    dear sir,
    i know how to retrive ms word while clicking the button action.,
    if know the path of file where it exists.
    if i dont know the path,i want to search ms word in exiting all directories
    and retrive msword .how to do search the file?
    please help me ,
    thanks ,
    pullareddy
    [email protected]

    Lets go back to your first question, the one you didn't post here. Why do you want to "retrieve ms word"? My guess is that you want to execute the Microsoft Word executable program and have it load a Word document that you happen to have available.
    If that's the case (and dozens of people have already asked that here), then do this:Runtime.getRuntime().exec("start yourdoc.doc");but put the actual file name in there in place of "yourdoc.doc".
    If you have some other reason for wanting to find MS Word's executable (e.g. you want to delete it), then please reply to this post and let us know.

  • How i read the file

    For each jsp file my parser create a java file. It also create a map file which holds information as which line number in java corresponds to which line number in jsp as some statements are being added by the parser.
    Now i have also generated a bdf file which holds information if any problem exist in the java file. As in this case it is intemidiate file now i have to generate a bdf file for jsp with the help of the bdf generated for the java file.
    How should i do this :-
    Now what i have to do is to read the bdf file generated for java it holds information related to line number on which problem exist. and use the map file so that bdf for jsp can be generated correctly.

    Grab the attached VI's from my answer on this discussion. It does what you want, but only works on Windows.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • How to search the file in all directoris

    dear sir,
    i know how to retrive ms word while clicking the button action.,
    if know the path of file where it exists.
    if i dont know the path,i want to search ms word in exiting all directories
    and retrive msword .how to do search the file?
    please help me ,
    thanks ,
    pullareddy
    [email protected]

    Sorry I do not understand your question.
    If your question is
    1. How Do I iterate over files in a Directory? Then see A1.
    -or-
    2. How do I let the user select a File (Dir)? Then see A2.
    A1:
    void processDir( String dirPath ) {
    File dirFP = new File( dirPath );
    String dirs[] = dirFP.list();
    for ( int i = 0; i < dirs.length; i++ ) {
    String fileName = dirs;
    String dirName = dirPath + File.separator + fileName;
    File theFile = new File( dirName );
    if ( theFile.isDirectory() == true ) {
    processDir( dirName );
    else {
    // Not Directory! ... It is a file!
    int nDot = fileName.indexOf( '.' );
    String ext = (nDot > 0 ) ? fileName.substring( nDot ) : "";
    // Process File...
    // To see if the extension is of a
    // particular Type...
    if ( ext.compareTo( "xyz" ) == 0 ) {
    // Process special file type...
    A2:
    String BrowsePath( )
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
    chooser.setMultiSelectionEnabled( false );
    JFrame parentFrame = null; // Or better!
    int returnVal = chooser.showOpenDialog(parentFrame );
    String result = null;
    if (returnVal == JFileChooser.APPROVE_OPTION)
    File selectedFile = chooser.getSelectedFile();
    result = selectedFile.getAbsolutePath();
    return result;
    -John
    null

  • How to read the file name....

    Hello all,
    I have a doubt on reading file name.
    I have 10 pdf files in the dir '/d01/tem/'
    I need to get/load those 10 file names using PL/SQL. Meaning I need to get the file names only not the file contents...
    Please help me to achieve this....
    Thanks and Regards,
    Muthu

    There is no public synonym for DBMS_BACKUP_RESTORE, so you need to prefix it with SYS and make sure your user has execute privilege on the package. This will fix call to DBMS_BACKUP_RESTORE, but you have another issue. - fixed tables. Only SYS can read them. You'd have to login as SYSDBA, create a view around x$krbmsft and grant select on it to your user.
    SQL> connect sys as sysdba
    Enter password:
    Connected.
    SQL> grant execute on DBMS_BACKUP_RESTORE to scott;
    Grant succeeded.
    SQL> create view v$krbmsft as select * from x$krbmsft;
    View created.
    SQL> grant select on v$krbmsft to scott;
    Grant succeeded.
    SQL> connect scott
    Enter password:
    Connected.
    SQL> set serveroutput on
    SQL> DECLARE
      2      p_directory VARCHAR2(1024) := 'C:\TEMP';
      3      p_null VARCHAR2(1024);
      4      i number := 1;
      5  BEGIN
      6      SYS.DBMS_BACKUP_RESTORE.searchFiles(p_directory, p_null);
      7      FOR x IN (select fname_krbmsft fname from sys.v$krbmsft) LOOP
      8        DBMS_OUTPUT.PUT_LINE(x.fname);
      9        EXIT WHEN i = 3;
    10        i := i + 1;
    11      END LOOP;
    12  END;
    13  /
    C:\TEMP\acbrd-0050.csv
    C:\TEMP\afiedt.buf
    C:\TEMP\A_3136_4000.log
    PL/SQL procedure successfully completed.
    SQL>SY.

  • How to call java files from different directories

    hi, how do i call java files from a different directory??
    let say i got partA.java, and i need to include functions from partB.java which is in a different folder. how can i do that?

    Chicon wrote:
    Hi nuttynibbles,
    Before the class declaration in partA.java, you must have an import statement like :
    import someDirectory.partB;
    public class partA {
    ... and before you ask... you'll probably want to read through this http://java.sun.com/docs/books/tutorial/java/package/index.html

  • How to read the text file present in the Al11 server through our program?

    My requirement is that , i have one file already present in the AL11 server. Now i want to take this file so that I can read this file .
    So will you please help me , how to read the file from AL11 server in our program ?
    Thankx in advance

    Hi..
    I too agree to the above post .. SEARCH in SCN before posting..
      DATA: lv_filename  TYPE string, "File name
            lv_line      TYPE string. "One line entry in a file
      lv_filename = iv_file_name.
      IF iv_location = gc_application.
        IF iv_record_count IS SUPPLIED.
      Open file
          IF gv_file IS INITIAL.
            OPEN DATASET lv_filename FOR INPUT IN TEXT MODE
                                     ENCODING DEFAULT.
                                     ENCODING DEFAULT
                                     IGNORING CONVERSION ERRORS.
            IF sy-subrc <> 0.
              RAISE file_open_error.
            ENDIF.
            gv_file = gc_check.
          ENDIF.
      Read data
          DO iv_record_count TIMES.
            READ DATASET lv_filename INTO lv_line.
            IF sy-subrc <> 0.
      Close file
              CLOSE DATASET lv_filename.
              IF sy-subrc NE 0.
                RAISE file_close_error.
              ENDIF.
              CLEAR gv_file.
    Exit from the loop
              EXIT.
            ENDIF.
    Regards
    Ansari

  • How to read the AFP file in hex format

    hi,
    I am reading a AFP file in hexstring format.But it is out put is not perfect means it is showing output close to the real one.
    How to read the file so taht i can get exact output in hex format.
    try{         
                        File inputFile = new File( "C:\\ACode\\afpfile.afp" ) ;
                        File outputFilehex = new File ( "C:\\ACode\\Hex.txt" ) ;
                        FileInputStream inputStream = new FileInputStream( inputFile );
                        Reader in = new InputStreamReader(inputStream,"Cp1252");
                        BufferedReader readableFile = new BufferedReader( in ) ;
                        FileOutputStream outputStreamhex = new FileOutputStream( outputFilehex );
                        Writer outhex = new OutputStreamWriter(outputStreamhex);
                        BufferedWriter writableFilehex = new BufferedWriter( outhex ) ;
         int line;
         String hext=new String();
         while ((line= (readableFile.read()))!=-1)
              writableFilehex.write(Integer.toHexString(line).toUpperCase());
         } writableFilehex.close() ;
    readableFile.close() ;
    catch( IOException e ) {
         System.out.println( e.getMessage() ) ;
         

    while reading i am getting most of hex charters are same except some places like instead of taking 00 its writing 0 and instead of f8 its writing fff.
    AFP is a IBM format for printing. Somehow i will be able to read that but how to covert it back to that format and store to that file.
    by trying is just storing data in hex format only
    Writer outhex = new OutputStreamWriter(outputStreamhex,"Cp1252");
    is there anyother way to store it back to this format

  • How to read the data file and write into the same file without a temp table

    Hi,
    I have a requirement as below:
    We are running lockbox process for several business, but for a few businesses we have requirement where in we receive a flat file in different format other than how the transmission format is defined.
    This is a 10.7 to 11.10 migration. In 10.7 the users are using a custom table into which they are first loading the raw data and writing a pl/sql validation on that and loading it into a new flat file and then running the lockbox process.
    But in 11.10 we want to restrict using temp table how can we achieve this.
    Can we read the file first and then do validations accordingly and then write to the same file and process the lockbox.
    Any inputs are highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hello Gurus,
    Let me tell you about my requirement clearly with an example.
    Problem:
    i am receiving a dat file from bank in below format
    105A371273020563007 07030415509174REF3178503 001367423860020015E129045
    in this detail 1 record starting from 38th character to next 15 characters is merchant reference number
    REF3178503 --- REF denotes it as Sales Order
    ACC denotes it as Customer No
    INV denotes it as Transaction Number
    based on this 15 characters......my validation comes.
    If i see REF i need to pick that complete record and then fill that record with the SO details as per my system and then submit the file for lockbox processing.
    In 10.7 they created a temporary table into which they are loading the data using a control file....once the data is loaded into the temporary table then they are doing a validation and updating the record exactly as required and then creating one another file and then submitting the file for lockbox processing.
    Where as in 11.10 they want to bypass these temporary tables and writing it into a different file.
    Can this be handled by writing a pl/sql procedure ??
    My findings:
    May be i am wrong.......but i think .......if we first get the data into ar_payments_interface_all table and then do the validations and then complete the lockbox process may help.
    Any suggestions from Oracle GURUS is highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

  • How to configure a scenario which posts same file to different directories

    How to configure a scenario which posts same file to different directories of a receiving system?
    Consider an Idoc to file scenario where I have to post same file to two different directories but logical receiver system has to be same.

    Hi,
    You can try out like this: Using multiple receiver interfaces you can send it to multiple directories with the help of enhanced interface determination/conditions and with the help of multiple receiver communication channels.
    Another option is to copy the file from one target directory into another directory  with the help of Unix script by executing the same from the OS command level.
    One more option is to create a Java Server Proxy and inside the proxy, you can write java code to FTP into different locations.
    Hope this helps,
    Regards,
    Moorthy

Maybe you are looking for