X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Oct 2008 06:53 AM by  anon
how to get all the data name in a directory
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 Oct 2008 06:53 AM
    hello, how to get all the data name in a directory. For example, in D:/data/, there are two thousand data file, how to get their name? Thanks in advance.    

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    14 Oct 2008 07:14 AM
    You can use IDL's FILESEARCH.  For example: files = FILE_SEARCH(*.dat', count=count)

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 Oct 2008 07:55 AM
    Thank you so much a great help. Idl can do anyting

    Deleted User



    New Member


    Posts:
    New Member


    --
    09 Dec 2008 07:19 AM
    Another trick you could use is the spawn function which will place all the filenames into a text file. For example the following command spawn, 'dir/B/S E:\01.01\* > c:\filesXX.txt' Creates a text file called filesXX in the C drive, which contains the names of all files in the folder E:\01.01\.  One caveat is that it becomes more difficult if the folder you are interested in contains spaces in it's name (e.g. if it is in Documents and settings) as spawn doesn't like it.
    You are not authorized to post a reply.