Get all files from Directory

Hi All,
My requirment is to get releted files from Local Directory.
For Example Path is "D/Data/"
in this path there is files like
abc123_de.txt
abc123_en.txt
xyz123_de.txt
abc123_pt.txt
xyz123_en.txt
pqr123_en.txt
bcg234_en.txt
sjd467_en.txt
Now i want to use only files which are strart from abc123 and use their data.
From which FM i can do it or how can i do this?
Thanks,
Mahipalsinh

Dear Mahipalsinh,
I have got the same requirement some days back, i think there is no FM for your requirement. so what i did, i have get all the files using below FM and Concatenate the ABC.
Please use the Below FM, because if the file name is above that 50 character that time always it gives the full file name. Please check, if u used the other one for getting the Files.
   CALL FUNCTION 'EPS2_GET_DIRECTORY_LISTING'
     EXPORTING
       iv_dir_name            = lv_dir_name
     TABLES
       dir_list               = lt_file_name
     EXCEPTIONS
       invalid_eps_subdir     = 1
       sapgparam_failed       = 2
       build_directory_failed = 3
       no_authorization       = 4
       read_directory_failed  = 5
       too_many_read_errors   = 6
       empty_directory_list   = 7
       OTHERS                 = 8.
   IF sy-subrc <> 0.
* Implement suitable error handling here
   ENDIF.
For reading Specific Files.
CONCATENATE 'AP' lv_internal_date INTO lv_filename.
         LOOP AT  lt_file_name INTO ls_file_name.
           lv_index = sy-tabix.
           IF ls_file_name-name CS lv_filename.
          " PUT YOUR LOGIC
          endif.
     endloop.
Thanks,
Nishant

Similar Messages

  • I recently purchased an iMac and used migration assistant to get all files from my emac, but now I have three user accounts.  I only want one (perhaps two) accounts.  I want all my music, photos and word docs from old computer in one user name

    I recently purchased a mac and used a firewire to transfer my files onto my new imac with migration assistant.  Now I have 3 users.  I want one with all my main files (pictures, music, files from my old computer).
    I don't mind having an additional "family" account so my younger daughter can't mess us things, but I can't figure out how to get files from one to the next and then delete the one user name.
    Thanks,

    In order to delete other accounts you must be logged into an admin account. You cannot delete the account into which you are currently logged.
    When you started the new computer you were in the Setup Assistant. You created a new admin account before finishing the setup. You need to log into that account because it is an admin account. You can then delete the account you migrated from the old computer (and any other accounts you don't need or want.)
    Then create a temporary new user account with admin status - name it, Temp. Log out of the current account and log into the new account, Temp. Now delete the initial account you created in Setup Assistant. You now have one account, Temp. Now re-migrate your data from the old computer. When that is completed log into the migrated account, which should be an admin account, and delete the temporary account, Temp.

  • How to get all changes from directory beginning from some time?

     

    Hi,
    If you make change one time means you can get old information by Restore method.More than one time means you can't get the info from the directory server.By better practice to take a backup for every day.

  • How to get all files from Archive server

    Hi Experts,
    My problem is:
    When i try to read from an archived file, the moment archive_open_for_read function module is executed, a popup box appears
    asking to choose the name of the archive file to be read.
    I have to pass only one Export Parameter i.e. Archive Object.
    How to avoid the popup screen from appearing. I want to read all the archived files by default, the values are to be retrived from the archived files and displayed.
    Thanks,
    Parthow.

    Hi,
    I probably didn't understand your question, as I think my answer is exactly what you expect.
    In an archive object, you may have 1 or more files. If you want to know the list of files in the object, you have to use ARCHIVOBJECT_GET_TABLE.
    Sandra

  • Get All Files from mimes & Display it

    hello experts!!
    How can I get file list from src\mimes\componetns\my.compoent.app folder to a table and open it(any kind of file) on lead select?
    nikhiL

    1) [File Download| https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71]
    2) [From Mimes| Display PDF in different window by reading Binary file in MIME folder.;
    Create a resource type from the file extension
    Thanks All

  • Functional module to get the File from a given Directory

    Hi all,
    I am using a FM name 'subst_get_file_list' to get the file from a given directory but it is accepting only 40 Character length file only my requirement is to accept file name other than 40 char,
    give me good sugestion
    regards
    paul

    Hi Paul,
    Check the Function Module Gayathri has given. ie. 'SO_SPLIT_FILE_AND_PATH'.
    In the exporting parameter FULL_NAME , give the path name and in the importing parameter stripped_name , you will get the filename.
    Check this code.
    REPORT ZSHAIL_SPLITFILE.
    data: it_tab type filetable with header line,
          gd_subrc type i.
    tables: rlgrap.
    data: path type string,
          file_name type string.
    parameters file_nam type rlgrap-filename .
    data: user_act type i.
    at selection-screen on value-request for file_nam.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        WINDOW_TITLE            = 'select a file'
       DEFAULT_EXTENSION       = '*.txt
        DEFAULT_FILENAME        = ''
        FILE_FILTER             = '*.txt'
        INITIAL_DIRECTORY       = ''
        MULTISELECTION          = abap_false
       WITH_ENCODING           =
      CHANGING
        file_table              = it_tab[]
        rc                      = gd_subrc
        USER_ACTION             = user_act
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if user_act = '0'.
    loop at it_tab.
    file_nam = it_tab-filename.
    endloop.
    endif.
    path = file_nam.
    CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
      EXPORTING
        full_name           = path
    IMPORTING
       STRIPPED_NAME       = file_name
      FILE_PATH           =
    EXCEPTIONS
      X_ERROR             = 1
      OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    at selection-screen.
    message i001(zmess) with file_name.
    Regards,
    SP.

  • I previously had PS CS5 Trial installed but removed it using both Control Panel Programs and deleting all files from the CS5 directory on Program Files.  I then installed a purchased product from Adobe disc using the serial number on the case.  But when I

    I previously had PS CS5 Trial installed but removed it using both Control Panel Programs and deleting all files from the CS5 directory on Program Files.  I then installed a purchased product from Adobe disc using the serial number on the case.  But when I try to launch it, I get a screen headed Photoshop CS5 Extended Trial.  It asks for the serial number and says that my trial has expired.  It rejects the serial number from the Adobe case saying "This Serial Number is not valid for this product".  It thinks that I still have the expired Trial Version installed.  How do I convince it (the program) that the Trial Version is long gone and the currently installed product was installed with a valid and accepted serial number????

    Let me know how it goes. Go into your Adobe account and register your serial number asap.
    https://www.adobe.com/account/my-products-services.html
    That way, should you lose it or you need support, it is on record that it's yours and you can fetch your s/n it from anywhere.
    There are too may sad stories here, where people forgot and the box is buried or lost.
    Gene

  • How can I create a array with all files from a directory

    How can I create a array of files or varchar with all files from a directory?

    I thought the example could be improved upon. I've posted a solution on my blog that doesn't require writing the directory list to a table. It simply returns it as a nested table of files as a SQL datatype. You can find it here:
    http://maclochlainn.wordpress.com/2008/06/05/how-you-can-read-an-external-directory-list-from-sql/

  • I had a computer crash and completed a Fresh install of Win7 and  restore of all files from Carbonite.  I have managed to get LR 5 running in LR.  However, I am not sure I have all of my previous catalogs. How can I find my catalogs to assure that I have

    I had a computer crash and completed a Fresh install of Win7 and  restore of all files from Carbonite.  I have managed to get LR 5 running in LR.  However, I am not sure I have all of my previous catalogs. How can I find my catalogs to assure that I have a complete inventory of all my catalogs.

    <moved from Downloading, Installing, Setting Up to Photoshop Lightroom>

  • Got a new external hard drive. Transferred all files from old hard drive to new hard drive. Connected hard drive to macbook. How do I get all my files to be recognized by iTunes and my already made playlists??

    Got a new external hard drive. Transferred all files from old hard drive to new hard drive. Connected hard drive to macbook. How do I get all my files to be recognized by iTunes and my already made playlists??

    Trying to download photos from IPHONE, IPAD to IPHOTO in IMAC after installing new hard drive.
    How did you import the photos to iPad and iPhone?
    If the photos have been synced to the iPhone and iPad using iTunes, you cannot sync them back.
    See this document:  http://support.apple.com/kb/HT4236
    You can't reimport pictures synced from your computer to your device back to your computer. You can only import pictures in the Camera Roll or Saved Photos from your device to your computer. If you need to retrieve synced photos from your device:
    If your photos are not in the Camera Roll on your devices, save them to the Camera Roll, share them to the Photo Stream, mail the photos, or, if you have iPhoto on the devices, use iTunes Photo Sharing.
    http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnkee26bc1
    Save photos to your computer using iTunes
    Connect your iOS device to your computer.
    Tap a photo, album, event, web journal, or slideshow and tap Share> iTunes.
    Tap Selected, or change the photos you want to save (if you are saving a slideshow skip to step 4):
    Select different photos: Tap Choose Photos, tap one or more photos, and tap Next.
    Select a range of photos: Tap Choose Photos, tap Range, tap the first and last photos in the range, and tap Next.
    Select all the photos in an album or event: Tap All.
    In iTunes, click the button for your device and click Apps at the top of the window.
    Below File Sharing, select iPhoto (in Apps).
    Select the Shared Photos folder under iPhoto Documents.
    Click Save To and select the location on your computer where you want to save the items.
    To view your photos, go to the Finder and look in the location you selected above.

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • How to get a file from an internet site

    I have a scenario where I need to get a file from a website.
    Basically on a weekly basis one our customers are going to upload a file that contains all the information for delivery's for the coming week.
    the way this used to be done is the user would go to the website directly and download the uploaded file.
    However now we want to do it as an automatic integration using PI.
    Does anyone have an idea how to do this?  Is it even possible?

    > Thridly my issue with regards to taking a file that is uploaded to a website (it will be a csv file), can be solved by creating a webservice?
    I am sorry, I misunderstood this. I thought you want to download.
    The upload is done with a HTTP POST, so you can use the HTTP receiver adapter.
    Use the prolog and epilog to simulate the form data post.
    Use an HTTP sniffer to get the whole HTTP stream, when you upload the file to the website to see, what you have to put in the HTTP adapter settings.
    Here are some threads about that topic:
    Receiver HTTP Adapter - multipart/form-data file post - SP19
    Re: HTTP Form Post Using HTTP adapter
    Regards
    Stefan

  • How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    You can't.  iCloud is not for general file backup from a Mac. It's for backup up and syncing data between mobile devices and and Macs and  The following is from this Apple document: iCloud: Backup and restore overview.
    iCloud automatically backs up the most important data on your (mobile) device using iOS 5 or later. Once you have enabled Backup on your iPhone, iPad, or iPod touch .....
    What is backed up
    You get unlimited free storage for:
    Purchased music, movies, TV shows, apps, and books
    Notes: Backup of purchased music is not available in all countries. Backups of purchased movies and TV shows are U.S. only. Previous purchases may not be restored if they are no longer in the iTunes Store, App Store, or iBookstore.
    Some previously purchased movies may not be available in iTunes in the Cloud. These movies will indicate that they are not available in iTunes in the Cloud on their product details page in the iTunes Store. Previous purchases may be unavailable if they have been refunded or are no longer available in the iTunes Store, App Store, or iBookstore.
    You get 5 GB of free iCloud storage for:
    Photos and videos in the Camera Roll
    Device settings (for example: Phone Favorites, Wallpaper, and Mail, Contacts, Calendar accounts)
    App data
    Home screen and app organization
    Messages (iMessage, SMS, and MMS)
    Ringtones
    Visual Voicemails
    But not from a Mac.  If you want to backup your photos and other important files I suggest you get an external hard drive and use  it with Time Machine.
    OT

  • Read file from directory, update contents of the each file

    hai,
    I could not understand how to debug the error i have now.
    target
    1- read the files from directory // i able ot do this part
    2- for each file
    for each file read the content & compare with the existing List & update the list // i able to do this part
    when i try to combine both parts , i got some following error
    run:
    E:\java\check\100130.ixf
    Error: children[i] (The system cannot find the file specified)
    BUILD SUCCESSFUL (total time: 2 seconds)
    i can see from the code that children[i] only gives the error when i use that in the second part of the code.
    can any one help me on this??
    Thanks
    Priyan
    the original code
    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStreamReader;
    import java.io.RandomAccessFile;
    import java.util.ArrayList;
    public class CompareList
         public static void main(String[] args){
             ArrayList a1 = new ArrayList();
             ArrayList a2 = new ArrayList();
             a1.add("1");
             a1.add("2");
             a1.add("3");
             a1.add("4");
             a1.add("5");
             a1.add("6");
             a1.add("7");
             a1.add("8");
             a1.add("9");
             a1.add("10");
             a1.add("11");
             a1.add("12");
             a1.add("13");
             a1.add("14");
             a1.add("15");
             a1.add("16");
             a1.add("17");
             a1.add("18");
             a1.add("19");
             a1.add("20");
             a1.add("21");
             a1.add("22");
             a1.add("23");
             a1.add("24");
             a1.add("25");
             a1.add("26");
             a1.add("27");
             a1.add("28");
             a1.add("29");
             a1.add("30");
             a1.add("31");
             a1.add("32");
             a1.add("33");
             a1.add("34");
             a1.add("35");
             a1.add("36");
             a1.add("37");
             a1.add("38");
             a1.add("39");
             a1.add("40");
             a1.add("41");
             a1.add("42");
             a1.add("43");
             a1.add("44");
             a1.add("45");
             a1.add("46");
             a1.add("47");
             a1.add("48");
             a1.add("49");
             a1.add("50");
             a1.add("51");
             a1.add("52");
              try{
                    File dir = new File("E:\\java\\check");
                    File[] children = dir.listFiles();
                    if (children == null) {
                          System.out.println("does not exist or is not a directory");
        else {
               for (int i = 0; i < children.length; i++) {
                       System.out.println( children);
    FileInputStream fstream = new FileInputStream("children[i]");
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String strLine;
    while ((strLine = br.readLine()) != null)      {
    String line =strLine.substring(0,2);
    // Print the content on the console
    //System.out.println(line);
    a2.add(line);
    } // end of add list2
    if (a1.size() > a2.size())
    int k = 0;
    for (int l = 0; l < a2.size(); l++)
    if (!((String)a1.get(l)).equals((String)a2.get(l)))
    //System.out.println((String)a2.get(i));
    // System.out.println("dd");
    k = l;
    k++;
    for (int l = k; l < a1.size(); l++)
    System.out.println((String)a1.get(l));
    String str = "children[l]";
    File file = new File(str);
    RandomAccessFile rand = new RandomAccessFile(file,"rw");
    rand.seek(file.length()); //Seek to end of file
    rand.writeBytes((String)a1.get(i)); //Write end of file
    rand.writeBytes("., 0.");
    rand.writeBytes("\n");
    }// end of comparing and updating the list2
              in.close();
    catch (Exception e){//Catch exception if any
    System.err.println("Error: " + e.getMessage());

    thanks for the information.
    i tried, the error
    like this
    run:
    E:\java\check\100130.ixf
    java.lang.StringIndexOutOfBoundsException: String index out of range: 2
            at java.lang.String.substring(String.java:1935) 
            at CompareList.main(CompareList.java:84)
    BUILD SUCCESSFUL (total time: 0 seconds)this comes because in my code i used children[i] as string in the later part
        else {
               for (int i = 0; i < children.length; i++) {
                        System.out.println( children);
    FileInputStream fstream = new FileInputStream(children[i]);
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String strLine;
    while ((strLine = br.readLine()) != null)      {
    String line =strLine.substring(0,2);
    a2.add(line);
    System.out.println(line);
    } // end of add list2
    if (a1.size() > a2.size())
    int k = 0;
    for (int l = 0; l < a2.size(); l++)
    if (!((String)a1.get(l)).equals((String)a2.get(l)))
    //System.out.println((String)a2.get(i));
    // System.out.println("dd");
    k = l;
    k++;
    for (int l = k; l < a1.size(); l++)
    System.out.println((String)a1.get(l));
    String str = "children[l]";
    File file = new File(str);
    RandomAccessFile rand = new RandomAccessFile(file,"rw");
    rand.seek(file.length()); //Seek to end of file
    rand.writeBytes((String)a1.get(i)); //Write end of file
    rand.writeBytes("., 0.");
    rand.writeBytes("\n");
    rand.close();
    }// end of comparing and updating the list2
              in.close();
    i stil could not figure out it yet. do u have any clue with this.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Is there any way to get the files from other computer ?

    Hai all,
    I have 2 computers connected. I know the IP address of other computer. Is there any way to get the files from other computer. (for e.g. I want to get the files from specific folder. In Java netwroking is it possible? (Any programs)
    regards,
    Namanc

    Bro Take it easy.
    Think you need to send a Image file named ("abc.gif")
    now develop a server using ServerSocket and connect it in local IP and any PORT
    For example i think ur server is connected in "localhost" and 9000 port.
    Now make ur server educated using some commands.
    For example:
    FileName: <File Name String>
    [Means new file is sending by connected client]
    FileSize: <File size long or int value>
    [ So that ur server can determind about the total length of sender file]
    DataModeOpen
    [Now your client will send its image data, this command means your client software is sending data]
    fjadlkfjaofaijojfwoeiurfodkjflsajlfksa
    l23j4lj23lkjlasjfoq23j4rokjelfkjasldkf
    2o3j4lk2j3ljslakdjf2l3j4 l23kjlk23k4j
    DataModeClose
    [Means file sending finished]
    Close
    [Means your client connection is closed]
    Now develop a client supporting this command.
    For example(Server):
    String getFileName=null;
    long getFileSize=0;
    public handleCommand(String getCmd) {
        if(getCmd.startsWith("FileName")) {
                String[] splitData=getCmd.split(":");
                this.getFileName=   splitData[1];
                outPutStream.writeBytes("+OK");
        } else if(getCmd.startsWith("FileSize")) {
                String[] splitData=getCmd.split(":");
                this.getFileSize=Long.parseLong(splitData[1]);
                outPutStream.writeBytes("+OK");
        } else if(getCmd.startsWith("DataModeOpen")) {
               //data mode open so receive data
              receiveData();
              outPutStream.writeBytes("+OK");
        } else if(getCmd.startsWith("DataModeClose")) {
              //close client socket
             getClientSocket.close();
    }For client:
    DataInputStream dataIn=null;
    BufferedOutputStream bout=null;
    public sendFile(bytes[] getBytes) {
            //if ok found then do other or show error message
        if(sendCmd("FileName:"+getFileName)) {
            if(sendCmd("FileSize:"+getFileSize)) {
                if(sendCmd("DataModeOpen")) {
                   bout.write(getBytes);
                } else {
                   showError(3);
            } else {
                   showError(2);
       } else {
            showError(1);
    }i think it will help u

Maybe you are looking for

  • Why do I have three of every file when I search in finder?

    When I open finder I see three of every file.  I don't  remember seeing this until recently.  Are these duplicates and, if so, how can I delete them without going to every file name?

  • Combo, Delta updates & software update

    Updated to 10.4.6 yesterday and reading other posters experiences. No problems here except for possible fan/overheating issues (fans seem to speed up then slow right down before gradually speeding up, etc, etc). My question is: is it possible for an

  • 10.5.7 No More Accounts w/o Homes?

    hi, with 10.5.7 server, i've noticed that one can no longer authenticate to OD accounts unless those accounts have a home directory associated with it. one used to be able to create an account w/o a home and the system would create a "99" folder on t

  • Does the null event work in 9.0.5?

    <handlers> <event name="null"> </event> </handlers>I have a null event and am calling a onNull event in the dataAction. The framework doesn't seem to call the onNull event. Thanks in advance.

  • TS2446 I tried the recomendation on how reset and do i cloud a million times and it does not work!!!!!!!!!!!!!!!

    This has been the most frustratin experinece in my life. All of the suden , icloud just topped!!! working yesterday. I did everything it says and I need it to do from the support and whatever and it doesnt work! I need to read MY EMAIL!!!!!!!!!!!!!!H