Jump to content
Sign in to follow this  
Mic

traversing directory structures

Recommended Posts

Mic

Absolute newbie at AutoIt .... still reading docs ... will it be possible to start at the top of a directory structure, read the whole tree and convert into xml, then search the xml for keywords? TIA,

regards,

Mic.

Share this post


Link to post
Share on other sites
JohnOne

Yes.

First look at _FileListToArray() <-helpfile or depending on your needs,

Stir in a bit of logic as you loop through the array.

I dont know anything about xml so this sample might seem silly, but will give you an idead as to where to get started.

#include <Array.au3>
#include <File.au3>
$aArray = _FileListToArray("C:\my\directory\location")
_ArrayDisplay($aArray)
Local $sString = ""
For $i = 1 To $aArray[0]
    $sString &= "<File>" & $aArray[$i] & "</File>" & @CRLF
Next

MsgBox(0,"Result",$sString)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Mic

Thanks for the info - works perfectly!

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  

×