How  to read all files  under a folder directory in FTP site

Hi Experts,
I use this SQL to read data from a file in FTP site. utl_file.fopen('ORALOAD', file_name,'r');
But this need to fixed file name in a directory. However, client generate output file with auto finename.
SO do we have any way to read all file by utl_file.fopen('ORALOAD', file_name,'r');
We need to read all file info. because client claim for security issue and does not to overwirte output file name,
we must find a way to read all file in output directory.
Thanks for help!!!
Jim

If you use Chris Poole's XUTL_FTL package, I believe that contains functions that allows you to query the directory contents.
http://www.chrispoole.co.uk/apps/xutlftp.htm
Edited by: BluShadow on Jan 13, 2009 1:54 PM
misread the original post

Similar Messages

  • How to Read all files inside resource Folder inside Jar?

    I have a Jar file,,,, The program reads for resource files in the resource folder inside the Jar. I want my program to read all files inside this folder without knowing the names or the number of files in the folder.
    I am using this to make an Applet easy to be updated with spicific files. I just want to add a file inside the resource folder and Jar the program and automatically the program reads what ever is in there!!
    I used the File class to get all file names inside the resource folder. it works fine before Jarring the program. After I jar I recieve a URI not Herarichy Exception!!
    File fold=new java.io.File(getClass().getResource(folder).toURI());
    String[] files=fold.list();
    I hope the question is clear!!

    How to get the directory and jar file that you class resides in:
    // returns path and jarfile (ex: /home/mydir/my.jar)
    public String getJarfileName()
            // Get the location of the jar file and the jar file name
            java.net.URL outputURL = YourClass.class.getProtectionDomain().getCodeSource().getLocation();
            String outputString = outputURL.toString();
            String[] parseString;
            int index1 = outputString.indexOf(":");
            int index2 = outputString.lastIndexOf(":");
            if (index1!=index2) // Windows/DOS uses C: naming convention
               parseString = outputString.split("file:/");
            else
               parseString = outputString.split("file:");
            String jarFilename = parseString[1];
           return jarFilename;
    }If your my.jar was in /home/mydir, it will store "/home/mydir/my.jar" in jarFilename.
    note: getLocation returns "file:/C:/home/mydir/my.jar" for Windows/DOS and "file:/home/mydir/my.jar" for windows, thus why I look for the first and last index of the colon so I can correctly split the string.
    If you want to grab a file in the jar file and get an InputStream, do the following:
    import java.io.*;
    import java.util.Enumeration;
    // jar stuff
    import java.util.jar.*;
    import java.util.zip.ZipEntry;
    public class Jaris
       private JarFile jf;
       public Jaris(String jarFilename) throws Exception
           try
                           jf = new JarFile(jarFilename);
           catch (Exception e)
                jf=null;
                throw(e);
       public InputStream getInputStream(String matchString) throws Exception
           ZipEntry ze=null;
           try
              Enumeration resources = jf.entries();
              while ( resources.hasMoreElements() )
                 JarEntry je = (JarEntry) resources.nextElement();
                 // find a file that matches this string from anywhere in my jar file
                 if ( je.getName().matches(".*\\"+matchString) )
                    String filename=je.getName();
                    ze=jf.getEntry(filename);
          catch (Exception e)
             throw(e);
          InputStream is = jf.getInputStream(ze);
          return is;
       // for testing the Jaris methods
       public static void main(String[] args)
          try
               String jarFilename=getJarfileName();
               Jaris jis = new Jaris(jarFilename); // this is the string we got from the other method listed above
               InputStream is=jis.getInputStream("myfile.txt"); // can be used for xml, xsl, etc
          catch (Exception e)
             // this is just a test, so we'll ignore the exception
    }Happy coding! :)
    Doc

  • How to read all files from a folder Diadem

    Hello,
    Can somebody tell me how to load automatic some .csv file form a folder to Data Portal in Diadem.
    I do some tests and during this tests I record  data ( .csv files), files that I load manual now (*FileNameGet  command), but I want when the tests are done and I load the script, then atomatic to load the csv files, analyze and build the report.
    Please advice me how can I do that.
    Thank you
    (Attached you have my program)
    Solved!
    Go to Solution.
    Attachments:
    scripts.zip ‏10 KB

    Duplicate Post here:
    http://forums.ni.com/ni/board/message?board.id=60&message.id=10467#M10467
    David_L | Certified LabVIEW Architect
    LabVIEW Tools Network | LabVIEW Tools Network Developer Center

  • How to read all files' name in a directory and store in a string array?

    as title

    One possibility is to use the listFiles() method, using recursion if you want the files in the sub-directory also. Check API documentation for java.io.File.

  • 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

  • Newbie question -  How to read all files for a backup

    Hello all,
    I have two users on my iMac. I am an administrator and the other user is a Standard user.
    From my account, I wish to run backup software that will backup the entire "User" directory. The problem I am having is that when I run the backup software (fyi: iBackup),
    it complains that it cannot read the files in the other user's account.
    I notice that when I browse to the other user's account, all the directories in their home folder are locked.
    How can I run my backup software so that it can read all files in the User directory?
    Thank you kindly!
    Jeff
    17" iMac Core Duo   Mac OS X (10.4.6)  

    Hi kneecarrot !
    I don't know if this will suit your needs, but one easy way of backing up other user's stuff is via the terminal . If you have an admin accountm just use:
    sudo ditto -rsrcFork /Users /Volumes/"nameof_anotherharddrive"/Users
    This will perform an identical clone of all your users home direcories for backup purposes. To restore the bkd'up files, just reverse the lines:
    sudo ditto -rsrcFork /Volumes/"nameof_anotherharddrive"/Users /Users
    ATTENTION: Be aware that it will restore the files to the exact structure and contents it was when backed up, erasing all new and modified files!! You may however copy just the files/folders you want to recover, e.g.:
    sudo ditto -rsrcFork /Volumes/"nameof_another_harddrive"/Users/"usera"/Documents /Users/"user_a"/Documents
    IMPORTANT: As with all terminal commands... be careful, think twice and double-check the syntax. You may want to test with non-critical stuff or demo user accounts first.
    Good luck,
    Michael
    MacBook Pro   Mac OS X (10.4.6)   2 Gig RAM

  • Read all Files from a Folder on Server

    Hi,
    Can anyone help me in finding if there's any way to read all files in a folder on the server?Any Function module or anything.
    Thanks

    On App server?  Try this sample program.
    report zrich_0001 .
    data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    data: wa(1000) type c.
    data: p_file type localfile.
    data: ifile type table of  salfldir with header line.
    parameters: p_path type salfile-longname
                        default '/usr/sap/TST/DVEBMGS01/data/'.
    call function 'RZL_READ_DIR_LOCAL'
         exporting
              name           = p_path
         tables
              file_tbl       = ifile
         exceptions
              argument_error = 1
              not_found      = 2
              others         = 3.
    loop at ifile.
      format hotspot on.
      write:/ ifile-name.
      hide ifile-name.
      format hotspot off.
    endloop.
    at line-selection.
      concatenate p_path ifile-name into p_file.
      clear itab.  refresh itab.
      open dataset p_file for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset p_file into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset p_file.
      loop at itab.
        write:/ itab.
      endloop.
    Regards,
    Rich Heilman

  • 10.6.4:  how to unlock all files in a folder

    hi,
    how do you unlock all files inside a folder?
    thank you..

    thank you.. (I wonder why you can't just do it by getting info on the folder, then saying, unlock all files inside.. (u can do like that in windows) this is always more practical than having to select all files (and accidentally opening them, or something...-) in windows you can select a folder and then say, (un)lock all files and and dirs -- and subdirs and files inside -- inside this folder.. can u do something like this in mac os? if not, that's not very good.. (I guess on the mac would need to find unix commands for doing something like this..)
    they really need to consider this for future versions, this is a no-brainer...;-)
    thank you..

  • Read All Files in a Folder

    I have a large set of data. Many don't have similar names at all. They
    all have the same data form (a 100x2 array for example).
    Is there a way to have a VI read all the files, one after another,
    automatically? It's a lot easier when the files are the same name, but
    ending/starting with different ID numbers. If they're all different,
    what can I do?
    Also, is it possible to create a VI, so that a file 'dropped' onto the
    VI's icon, will cause it to process the data? I'm not sure if this is
    a Labview or MS Windows problem.
    Thank you for your time.
    -Dorian
    [email protected]
    Please post if possible, to share.

    Dorian;
    You can simplify this if all your files are in the same directory. Check the example attached that read all .jpg images in a directory and display them in a picture control. Enter the directory path before running.
    As for your second question, it can be done, but I think (I might be wrong) that you must convert your vi into an executable. Check the following example:
    Get Calling File Path from Command Line
    Best regards;
    Enrique
    www.vartortech.com
    Attachments:
    image_show.vi ‏24 KB

  • How to retrieve all files in a given directory?

    Hi all,
    I am a newbie to Java. I have to retrieve all files in a given directory. The names of the files are not known to me. Only the name of the directory is known. How can I retrieve and read all those files?
    Gary

    Check out the list and listFiles method: http://java.sun.com/j2se/1.3/docs/api/java/io/File.html

  • How to read .mdb file from shared folder

    Hi All,
    In one of my local computer I have a shared folder and within the folder I have a .mdb file. Now I am trying to read that file from MII. I have tried with Get_File_List action block. I am providing the following information to Get_File_List
    Folder :
    <Computer Name>\<Shared Folder Name>
    Mask: .mdb
    But in return of Get_File_List, I am not getting any file related information. It is only providing like below
    <Rowsets>
    <Rowset>
    <Columns>
    <Column Description="Name" MaxRange="0" MinRange="0" Name="Name" SQLDataType="1" SourceColumn="Name"/>
    <Column Description="Date" MaxRange="0" MinRange="0" Name="Date" SQLDataType="93" SourceColumn="Date"/>
    <Column Description="Size" MaxRange="100" MinRange="0" Name="Size" SQLDataType="4" SourceColumn="Size"/>
    <Column Description="LastWriteDate" MaxRange="0" MinRange="0" Name="LastWriteDate" SQLDataType="93" SourceColumn="LastWriteDate"/>
    <Column Description="ReadOnly" MaxRange="1" MinRange="0" Name="ReadOnly" SQLDataType="4" SourceColumn="ReadOnly"/>
    <Column Description="FullPath" MaxRange="0" MinRange="0" Name="FullPath" SQLDataType="1" SourceColumn="FullPath"/>
    </Columns>
    </Rowset>
    </Rowsets>
    Can anybody suggest me how to achieve it.
    Thanks in advance
    Chandan

    Hi Chandan,
    Specify the mask as *.mdb and try.
    Thanks,
    Dipankar

  • How to move all files from a folder for a user to a centralized folder on a core server with a GP

    Hello,
    I was curious if someone know how to move all the files of a user "local" profile on a Terminal Server to that of a centralized server where the "local" profile of like the user desktop, favorites, setting, etc are stored in the event
    the local profile on the TS become corrupt it can pull from this server...
    The problem I have is no matter what I tell users to save there files to our Y drive that is a folder that is synced
    across all 6 of our TS servers, users still store files on there desktops, so as you can imagine if one day they are on one server, then next day they could be on another and there files aren't the same.... hence the reason why I want to move all there files
    to the centralized server so when I redo the profiles from scratch on the TS server in the farm they suck files from the core server and have all of the files they are used to having.... 
    So I was curious and I've heard from some this is possible in a GP, but I'd like to move the contents of all 6 TS for
    each user or if I have to d this on  per user basis I will, just looking for a way to move the files....

    Hi Trevor,
    To move all users’ desktop to a server, we can use Folder Redirection to do this. The path for Folder Redirection is:
    [Group Policy Object Name]\User Configuration\Policies\Windows Settings\Folder Redirection
    In this situation, we can choose to redirect desktop to the root of a network file share or a folder on a network share.
    Regarding how to configure this, the following article can be referred to for more information.
    Configuring Folder Redirection
    http://technet.microsoft.com/library/cc786749.aspx
    Hope it helps.
    Best regards,
    Frank Shen

  • File Utility - Find operation; How to retrieve all files in a folder?

    I am using Find operation of FileUtility service to count the number of files present under a given folder.
    I can not find the correct Regular Expression to match all files.
    The Adobe documentation mentions that * character is default which matches all files/folder within the Directory. However, If I leave * unchanged, I'm getting an error "Incorrect Regular Expression syntax".
    I have tried different combinations, nothing seems worked.
    Can anyone assist me on this?
    Thanks,
    Nith

    Hi,
    You can use the following syntax to get the list of all files:-
    \w*\.\w*
    Yow can alslo go through the following material for details on Regular Expressions:
    http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=000582.html
    Thanks

  • How to read resource file under the WEB-INF through ClassPathResource

    I have an xml file under the directory WEB-INF but WEB-INF/classes, I want to read it through ClassPathResource class from Spring, and where I read this xml file is not in a Servlet class, how can I do? Thank you.

    Webmethods should be able to handle it. if not you should convert the tline content into one xstring and pass it to webmethods.
    othe option
    if you are on WAS6.20 and above you can use BSP to achieve what you are looking for.
    Regards
    Raja

  • Scripting: how to read all files in specific subfolders?

    Hello,
    via a Fireworks script (.jsf) I want to get all files in specific subfolders e.g. of "d:\images" to do something with these files (exporting as JPEGs).
    What are these commands?
    Thanks!
    carlos

    You would use Files.enumFiles:
    http://help.adobe.com/en_US/fireworks/cs/extend/WS5b3ccc516d4fbf351e63e3d1183c94988d-7ee8. html
    Aaron
    http://fireworks.abeall.com

Maybe you are looking for

  • Quicktime movies don't show in browser

    Was having trouble with quicktime movies playing in Safari and Firefox. Each time I got the broken Q, I would restart the computer and it would work for a while. Upgraded to OS X(10.5) in hopes that might help. It didn't. No matter what I do no Quick

  • WRT54G v7 WAN DHCP client problem

    I've recently started having a strange problem with my WRT54G. Internet access is via a Cable modem and has been working fine for months, and the cable modem works fine so I suspect the problem is with the router. However the router is also working,

  • Standard vs Proxy Ad Plug-in

    We are planning to build an advertisement plug-in with all the regular ad features such as pre, mid, post rolls and overlays. Before we build, we are trying to figure out whether we should take a standard plug-in or a proxy plug-in approach. Does any

  • Reg LPA Delivery schedules - MRP

    Hi Delivery schedules got created via MRP - LPA document type We haven't released to vendor [JIT or Forecast] When i manually change quantity in generated delivery schedule, Firmed indicator is ticked as expected i am unable to uncheck this indicator

  • EDQ Match Review - retrieving decisions without running the owning process

    We're running Dn:Director v8.1.2 (458) with Match Review. We have a tiered set of match rules on two seperate sources of products, each level (set) controlled be a seperate process but all working from the same pair of staged data tables. Depending o