Multiple File Handling

I am looking for the example that can handle multiple files. Requirement is to check how many files are present in the unix folder usr/temp/ - pick one file - and move it to /usr/temp/processed/ folder
Please provide pointers to the code example that can achieve this.
TIA.

HMM wrote:
I am not sure, how to pick one file at a time from a given directory. Thanks!Please be clearer. What's the problem: finding out the files in a directory, or in the picking.

Similar Messages

  • Last run date & time & multiple files handling

    Hi frnds,
    i am working on an outbound interface in which i am retrieving data from custom db table,processing it with other db tables and writing  the final output into a file into the application server and updating the custom db table.
    Now i have an issue here when i am giving plant as input in selection screen (select-options), i should also get those plants from my custom table which have no last run date and time.
    How to get that?
    Next part of my question is for multiple plants entry,multiple files have to created in application server.
    Presently, i have concatenated the file path n name.Do i need to loop the same with s_werks.Will it work
    Also i used an internal table for update data storage.When multiple plants are their how to handle the updation.
    Rgds,
    Simran

    Hi.
    In ur reply i did'nt understood two things
    1) this is how i'm doin the selection
        select lt_run_dt
               lt_run_tm
        into table itab1
        from z_table
        where prog_name EQ sy-repid
        AND   plant IN s_werks
    will it give me plants whose last_run_date and last_run_time are not in the z table?
    2)  If you are going with select-option from parameter, then if you have to write a FILE per PLANT. Then you can loop at plant->extract the data-> write to app server-update z table->end loop
    Does that means:
    loop at s_werks
    open dataset
    transfer
    modify
    endloop
    Kindly clarify to solve this issue.
    Rgds,
    Simran

  • Multiple file links in a single page: A better way to/efficient way to handle ?

    Aloha Everyone!
    I would like to ask the community how they have handled multiple file links in a single page. Sort of a pseudo database of files.
    Here is the webpage I have been working on:http://huichawaii.org/
    Here is what I have done to show files so far:
    old version:http://huichawaii.org/proceedings---2012-education%2c-math---engineering-technology.html
    new version: http://huichawaii.org/ahs2013-proceedings.html
    The website works best in Chrom or Firefox, still have to convert the flash header to an edge animate .
    Mahalo in advance for everyone's input!

    Depending on what other text you might have, you could use the data list component.
    To get the text to have underlines, you will need to edit the repeated item. You can also adjust colors and fonts as well. The default rollover and selected states will probably not be the UI that want, so make sure you change those as well.
    Now for the interactivity, select the datalist, and use the interactions panel, choose "On Select", then "Go To Url", the trick is to make sure the "When a specific item is selected" is also set. Here are the basic settings to get your links working:
    Add new interactions for each item you want to be functional.

  • How to handle flat file dissembler in biz-talk from getting spited in to multiple files???

    Hi,
    How to handle flat file dissembler in biz-talk from getting spited into multiple files according to number of transaction sets???
    where the Map flow is from Flat file to X12 Standard files.
    Please advise...

    You can go through following links:
    Developing
    Custom Pipeline Components
    How
    to Develop BizTalk Custom Pipeline Components - Part1
    Custom
    BizTalk Pipeline Disassembler Component
    Creating
    a custom BizTalk 2010 pipeline component–Part I
    add one more which talks about extending the FFDASM @http://msdn.microsoft.com/en-us/library/ee267856(v=bts.10).aspx
    Regards,
    Rachit
    Vote, if you find it useful.

  • How Do RoboHelp 9 WebHelp Generated Files Handle Map IDs and Aliases?

    The text below was written by our team's developer/architect. I am the help author who uses RoboHelp to write content and generate the help files, but I am clueless how it all gets generated and is deployed. Please help. We use RoboHelp 9. I use it in Windows XP and our app and help run on IE 7, 9, and Firefox (multiple versions).
    "Our application uses the numeric identifiers associated with the Map ID. For example, to get to the <appname>_home_page.htm file, we use the number 1053. <appname> = pecs, in this example.
    All of this is used in a call to a RoboHelp method defined in the RoboHelp_CSH.js file. The mehtod we are calling is the RH_ShowHelp() JavaScript method and the code to perform the call, when you click on Page Help, is this:
    RH_ShowHelp(0, ''/pecsHelp/index.htm>pecsHelp',HH_HELP_CONTEXT,topic);
    Topic is translated to the Map ID number for the page help. HH_HELP_CONTEXT is defined in the RoboHelp_CSH.js file. This method translates into a URL and from what I have seen, the URL that gets generated is this:
    http://{server}[:port]/pecsHelp/index.htm/{server}[:port]/pecsHelp/index.htm#<id=1053>>pecsHelp
    Server and port get replaced with the appropriate values. I have no clue how id=1053 is supposed to get translated to mean "pecs_home_page.htm". If you check the PECS_help.h file, you will see the following entry:
    #define PECS_Home_Page1 1053
    Then in the RoboHelp alias file (PECS 3.0.ali), the following line is in the file:
    <alias name="PECS_Home_Page1" link="pecs_home_page.htm"> </alias>
    But both of these files are used during the WebHelp generation process and I don't know how the WebHelp generated files handle the Map ID and aliases."

    You need to assign the numbers you find in the pecs_help.h file to topics in your help. You do this in Context Sensitive Help > Map Files > All Map IDs. (From RH7, but I assume the location is similar in RH9.) This creates the entries in the .ali file.
    Peter Grainge suggests a couple of sites to read for a greater understanding here:
    http://www.grainge.org/pages/authoring/calling_webhelp/using_map_ids.htm
    (Although the second  site is based on RH X5, the basic concepts and procedures should be very similar. )
    HTH,
    Amber

  • Is there a way to select MULTIPLE tabs and then copy ALL of the the URLs and titles/or URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; However, I prefer to use a Firefox feature rather than download an add on. Thanks.

    Currently, I can copy ONE tab's url and nothing else (not its name). Or I can bookmark all tabs that are open. However, I'd like to have the ability to select multiple tabs and then copy ALL of the the URLs AND their titles/or copy ALL of the URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; when I download the add on, I get a message saying that using the add on will disable Firefox's tab features. I prefer to use Firefox features rather than download and use an add on. Is there a way to do this without an add on?

    Hi LRagsdale517,
    You should definitely be able to upload multiple files by Shift-clicking or Ctrl-clicking the files you want to upload. Just to make sure you don't have an old version of the service cached, please clear the browser cache and then log in to https://cloud.acrobat.com/files. After clicking the File Upload icon in the upper-right corner, you should be able so select multiple files for upload.
    Please let us know how it goes.
    Best,
    Sara

  • Can no longer print multiple files from a PDF package

    Prior to our upgrade to Acrobat Pro X, we had the ability to print multiple files within a PDF package.  We would simply select the files we wanted to print, say print and it would print them all.  It no longer does so, although it still allows us to select multiple files and to select ALL from the print menu but then it only sends the first file to the printer.
    We have tried it on both Windows XP and Windows 7 and it won't work correctly on either one.
    Does anyone have any ideas?  This is very frustrating as these packages are created by folks bundling their e-mail messages to send to the fileroom for printing and filing in the official case files.  With the old method we were able to quickly print out all the messages without attachments, and then would only have to individually print those messages that had attachments.  As stands now if we get a package with 100 messages in  it we will have to select and print each file individually instead of being able to print the 75 without attachments as one print job and then only have to do the seperate handling for the remaining 25 with attachments.
    Any and all suggestions are welcome.

    I'm using windows 7. The Acrobat that came with the Adobe Creative Suit 4 is Adobe Acrobat Pro. When I am on a web site that has a page in PDF I click on the printer icon and the print page comes up but the preview side is blank and will not print the page.

  • I have a brand new macbook pro 15" with latest Lion.Can anyone tell me why, when I open word or preview etc that multiple files open?For eg if I open a word doc, the last 1-3 docs that I have worked on all open. why?

    I have a brand new macbook pro 15" with latest Lion. Can anyone tell me why, when I open word or preview etc that multiple files open?For eg if I open a word doc, the last 1-3 docs that I have worked previously on all open. Can anyone tell me why?

    You have a choice as to whether or not applications in Lion like Word or Preview (or even Safari) save and re-open previous documents or windows... just hold down the option key while quitting a program and when you re-open it you won't get the previous documents or windows when you re-open the application. You can see this by selecting the open program in the menu bar and when holding down the option key the quit function will change to quit and discard open windows. This feature in Lion is referred to as "Resume" and is great if you want to restart an app and return to what you're doing (for example in Safari re-opening existing windows and tabs from your previous session). You still have the option to close individual windows within an app before quitting and they will not re-open when the app is launched again.
    This Resume function is not related to saving your work (a word or text document for example). This is handled by Lion's "Auto-Save" and "Versions" functions. See http://www.apple.com/ca/macosx/whats-new/auto-save.html
    Hopefully this is the complete answer you're looking for.

  • File corruption on SDCard when multiple files are being written from WinCE 6.0R3

    We currently have file corruption problems which we have been able to reproduce on our system which uses WinCE 6.0R3. We have an SDCard in our system which is mounted as the root FS.  When multiple files are being written to the file system we occasionally
    see file corruption with data destined from one file, ending up in another file, or in another location in the same file.  We have already written test SW that we have been able to use to reproduce the problem, and have worked with the SDCard vendor to
    check that the memory controller on the card is not the source of the problems.
    We know that the data we send to WriteFile() is correct, and that the data which eventually gets sent through the SDCard driver to the SD card is already corrupted.
    We believe that the problem is somewhere in the microsoft private sources between the high level filesystem API calls and the low level device calls that get the data onto the HW.
    We have confirmed that the cards that get corrupted are all good and this is not a case ofpoor quality flash memory in the cards. The same cards that fail under WinCE 6.0R3 never fail under the same types of testing on Windows, Mac OX, or linux.  We
    can hammer the cards with single files writes over and over, but as soon as multiple threads are writing multiple files it is only a matter of time before a corruption occurs.
    One of the big problems is that we are using the sqlcompact DB for storing some data and this DB uses a cache which get's flushed on it's own schedule. Often the DB gets corrupted because other files are being written when the DB decides to flush.
    So we can reproduce the error (with enough time), and we know that data into the windows CE stack of code is good, but it comes out to the SDcard driver corrupted.  We have tried to minimize writes to the file system, but so far we have not found a
    way to make sure only one file can be written at once. Is there a setting or an API call that we can make to force the OS into only allowing one file write at a time, or a way of seeing how the multiple files are managed in the private sources?
    Thanks
    Peter

    All QFE's have been applied we are building the image so we have some control.
    I have build an image which used the debug DLL's of the FATFS and I have enabled all of the DebugZones.  The problem is still happening. From the timings in the debug logs and the timestamps in the data which corrupts the test file I have been able
    to see that the file is corrupted AFTER the write is complete. Or at least that's how it seems.
    We finished writing the file and closed the handle. Then more data is written to other files. When we get around to verifying the file it now contains data from the files that were subsequently written.
    What I think I need to do is figure out in detail how the two files were "laid down" onto the SDCard.  If the system used the same cluster to write the 2 files then that would explain the issue.

  • How to uploade multiple files in Apex

    Hi All,
    I went through the documnet to up;oad the files in apex which is wroking fine perfectly.
    But how do we upload multile files at a time.
    If we observe here we are using P2_File_name as one of the browser filed, similarly i have created three more browser buttons with names a s P3_file_name and P4_file_name
    so how do chnage the proces to handle multiple files to uplaod at a ttime.
    Here is the process i have followed.
    IF ( :P2_FILE_NAME is not null ) THEN
    INSERT INTO oehr_file_subject(id,NAME, SUBJECT, BLOB_CONTENT, MIME_TYPE)
    SELECT ID,:P2_FILE_NAME,:P2_SUBJECT,blob_content,mime_type
    FROM APEX_APPLICATION_FILES
    WHERE name = :P2_FILE_NAME;
    DELETE from APEX_APPLICATION_FILES WHERE name = :P2_FILE_NAME;
    END IF;
    Abd for downloading the file i have used a proceudre
    create or replace PROCEDURE download_my_file(p_file in number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM oehr_file_subject
    WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end download_my_file;
    Thanks,
    Anoo..

    Hi,
    Take it easy, you can use plugin:
    http://apex-plugin.com/oracle-apex-plugins/item-plugin/multiple-file-upload_95.html
    http://apex-plugin.com/oracle-apex-plugins/odtug-competition/filedrop_202.html
    Regards,
    Fateh

  • 1:N mapping without using BPM -- IDOC to multiple files

    Hi all,
    I am facing a problem while sending multiple files,
    I need to send files ( File1, File2 or FIle3) ...
    I was able to successfully send the first 2 files and along with it the 3rd file is being created without any data... How to stop this file( either file2 or file 3 should be created) in creating..
    I have done the sceanrio like this, )ALL the source and target files are XSD's imported)
    In the Message Mapping <b>Messages Tab</b>
    <b>Source is AFS_DELVRY03   occurence is 1,
    Target files
    rootI8 occurence is 1,
    rootI9 occurence is 0...1,
    rootIB occurence is 0...1</b>
    I have done all the maping part , problem is all 3 files are being created(eventhough 2nd or 3rd has no data) , I need rootIB, either rootI9 or rootIB based on condition,
    So any one has done the similar scenario, If please suggest me how to hadnle so that only 2nd or 3rd file should be created,
    In Interface Determination i have selected the extended option also...
    Should i do any specific handling in the Configuration part or should i create more than one mapping?..
    U r suggestions are welcome and will be rewarded with points,
    Regards,
    sridhar

    Venu,
    Using a BPM, you can do the mapping / Split as needed and then send the files individually, using a Sens Step as needed. There are multiple ways in which this can be done with a BPM.
    But, for a solution without a BPM, as the requirement is such that only 2 of the 3 target messages need to be created, multimapping would not work and the need for conditional routing occurs.So, this would require additional mappings.
    The solution is either use a BPM or  do the logic using Conditional Routing. Ofcourse the second solution requires 3 mapping programs , but you are avoiding a BPM which can cause a perfromance bottle neck.
    If perfromance cannot become a bottle neck, then using BPM would make much more sense , but again it all boils down to the exact requirements and the feasibilty of the solutions!
    Regards,
    Bhavesh

  • In oracle B2B multiple files are getting picked from SFTP location for one file in custer environment

    Flow is like :
    REST ENDPOINT->OSB PROXYSERVICE->BUSINESS SERVICE->B2B SFTP LOCATION->B2B->SOA JMS Queue->SOA COMPOSITE-
    Due to cluster environment, there is issue when B2B picks the file from SFTP location for Custom protocol using sftp listening channel. Sometimes B2B picks multiple files from SFTP location for just one copy of file. It is happening because of cluster environment 4 instances of server is looking into the SFTP location for picking the file and sometime 2 or more instances of server are reading same file and sending the copy to B2B.
    Please let me know , how can I stop this behavior

    All QFE's have been applied we are building the image so we have some control.
    I have build an image which used the debug DLL's of the FATFS and I have enabled all of the DebugZones.  The problem is still happening. From the timings in the debug logs and the timestamps in the data which corrupts the test file I have been able
    to see that the file is corrupted AFTER the write is complete. Or at least that's how it seems.
    We finished writing the file and closed the handle. Then more data is written to other files. When we get around to verifying the file it now contains data from the files that were subsequently written.
    What I think I need to do is figure out in detail how the two files were "laid down" onto the SDCard.  If the system used the same cluster to write the 2 files then that would explain the issue.

  • 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?
    Thanks
    Sahil

    Hi,
    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 ->
    /people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi
    regards
    Arvind R

  • Multiple input files to multiple file outputs

    I have a workflow that can select multiple files and zip them into a single zip file.
    What modification should I do to get a workflow that zips each of the files separately into separate zip files?
    So I can select multiple files but each file is zipped into a separate file.

    You can use a Run AppleScript action do do it - the following action can be used instead of the Finder's Create Archive action:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 335px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters}
    -- create a PKZip archive of the selected Finder item(s)
    -- if no destination folder is specified, the archive will be placed in the same location
    -- input: a list of Finder items to archive
    -- output: a list of Finder items archived
    set output to {}
    set SkippedItems to {} -- this will be a list of skipped items
    set DestinationFolder to missing value -- a Finder path to a destination folder if different
    repeat with SomeItem in the input -- step through each item in the input
    try
    set SomeItem to SomeItem as text
    if the last character of SomeItem is in {":", "/"} then set SomeItem to text 1 thru -2 of SomeItem
    set ArchiveSource to POSIX path of SomeItem
    if DestinationFolder is missing value then -- save the archive to the same location
    set ArchiveName to ArchiveSource & ".zip"
    else -- save the archive to the specified folder
    set TheName to name of (info for SomeItem as alias)
    set ArchiveName to (POSIX path of DestinationFolder) & TheName & ".zip"
    end if
    do shell script "ditto -ck " & (quoted form of ArchiveSource) & space & (quoted form of ArchiveName)
    set the end of the output to (POSIX file ArchiveName) as alias -- success
    on error ErrorMessage number ErrorNumber
    log ErrorMessage
    set the end of SkippedItems to SomeItem
    end try
    end repeat
    if SkippedItems is not {} then -- handle skipped items
    set TheCount to (count SkippedItems) as text
    display alert "Error with Archive action" message TheCount & " items(s) were skipped - workflow will continue"
            choose from list SkippedItems with title "Error with Archive action" with prompt "The following items were skipped:" with empty selection allowed
    if result is false then error number -128 -- user cancelled
    end if
    return the output -- pass the result(s) to the next action
    end run
    </pre>

  • Problems transferring multiple files

    I'm trying to write a program to transfer multiple files from a client to a server, but I'm having trouble getting the server to distinguish between them.
    I have tried both buffered streams, and straight input/output streams, and in both cases, the server doesn't seem to get any EOF, and keeps reading all data it reads into the first file. I can't figure out why EOF is never read (ie: ((read = bis.read(buffer)) != -1) never evaluates to -1). Can anybody see why that might be?
    Client:
    buffer = new byte[16384];
    out    = serverSocket.getOutputStream();
    bos    = new BufferedOutputStream(out);
    objOut = new ObjectOutputStream(out);
    objOut.writeInt(file.length);  // # of files to transfer
    for (int i=0; i<file.length; i++) {
        try {
            fileIn = new FileInputStream(file.getAbsolutePath());
    objOut.writeLong(file[i].length()); // file length (for dirty CRC check)
    objOut.writeObject(file[i].getName()); // file name
    objOut.flush(); // because otherwise the server hangs waiting
    while ((read = fileIn.read(buffer)) > 0) {
    bos.write(buffer, 0, read);
    bos.flush();
    catch (Exception e) {}
    Server:
    in = socket.getInputStream();
    objIn = new ObjectInputStream(in);
    bis = new BufferedInputStream(in);
    fileCnt = objIn.readInt();  // # of files to be transferred
    for (int i=0; i<fileCnt; i++) {
        totalLen = objIn.readLong();  // file length
        try { fileName = (String)objIn.readObject(); }  // file name
        catch (Exception e) {}
        try { toFile = new FileOutputStream(new File(fileName)); }
        catch (FileNotFoundException ex) {}
        while ((read = bis.read(buffer)) != -1) {
            toFile.write(buffer, 0, read);

    the problem is you are not stoping the writing to file when you hit the end of one file.
    At the server you should count the number of bytes that you write to the disk and should stop when the total count reach the file size.
    Or you have to completly change your protocole to handle entire file as one unit.
    Ex:-
    public class MyFile implements java.io.Serializable{
    String path;
    private void writeObject(ObjectOutputStream oos){
       oos.defaultWriteObject();
       byte b[] = new byte[1024*128];
       int i = 0;
       FileInputStream fis = new FileInputStream(path);
       while ((i = fis.read(b)) >=0){
          oos.writeObject(trim(b,i));
       fis.close();
       oos.writeObject("EOF");
    private byte[] trim(byte b[], int i){
        byte b2[] = new byte;
    System.arraycopy(b,0,b2,0,i);
    return b2;
    // You should be able to write the read object method

Maybe you are looking for

  • Appending data(Image and Text) to a file written with RTFWriter2.

    I have file witten using RTFWriter2 which contains image and text.I nedd to modify the contents of that file at runtime through browsing and selecting the JFileChooser and append the data to existing selected file. I write inot the file for the first

  • Recommended patch 120445-01 will not install with Sol. 9 (09/2005)

    Patch 120445-01 will not apply to a Solaris 9 (09/2005) setup. The hardware is an Ultra-80. Although it is recommended, it fails with the "patchadd" message: Checking installed patches... One or more patch packages included in 120445-01 are not insta

  • Dynamic header and footer for ALV_LIST

    Hi all, I m using FM REUSE_ALV_LIST_DISPLAY to display my report. My requirements are as follows: 1. Display the header for every new key/sorted value 2. Display the footer at the end of the key/sorted value 3. Display a subtotal for numeric columns

  • Com.sun.xml.tree.XmlDocument;

    Is there any class with that name, where can I find it? N.B. I already installed jaxp and include it in the classpath Ramzi

  • Best way to write the following query

    Hi , I've the following table structures and data.. And i've written the query to get the records which are greater than BBB- But could you please hint me to write in simpler way. create table obj (ob_id ) as select 1 from dual union all select 2 fro