Sign in to follow this  
Followers 0
elite

For each file in a directory

5 posts in this topic

I've had a bit of a search for this but haven't turned up any conclusive results...

How can I perform a function on each file in a directory - I'm guessing while or for, but I don't see how to put all of these in an array and iterate through them - or have I got the wrong end of the stick?

TIA

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

straight from help

#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If (Not IsArray($FileList)) and (@Error=1) Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf
_ArrayDisplay($FileList,"$FileList")

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

straight from help

#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If (Not IsArray($FileList)) and (@Error=1) Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf
_ArrayDisplay($FileList,"$FileList")

8)

Point taken :o

Wood for the trees...

Thanks for taking the time for a noob

Share this post


Link to post
Share on other sites

Hi,

If you need more control and recursing, there are a number of solutions in the thread, link in my signature for "recurse"

Best, Randall

I'm only need the files one directory deep - but the link is bookmarked and has given me ideas for expansion

tnx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0