Sign in to follow this  
Followers 0
D4rk^S0ul

Getting all types of files

7 posts in this topic

Is there anyway to get all types of files that are in a folder and the sub folders?

Like if i needed to find all .txt files in my docs so i can add a line to them how would

i do this?

Share this post


Link to post
Share on other sites



Umm, this may not work but just a thought

dim $arr[1]
$Search = FileFindFirstFile("*.txt")
While 1
Redim $arr[ubound($arr, 1) + 1]
$arr[ubound($arr, 1) - 1] = FileFindNextFile($search)
if @error then exitloop
WEnd
FileClose($search)

that _should_ work, i think... should make an array full of file names


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

I know this must seem a newb question but how can i use the array to make a msgbox or to run functions with the locations?

Share this post


Link to post
Share on other sites

umm

For $i = 0 to ubound($arr, 1) - 1
msgbox(0,'',$arr[$i])
next

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

umm

For $i = 0 to ubound($arr, 1) - 1
msgbox(0,'',$arr[$i])
next

~cdkid

1 Prob it only shows 1 instead of doing untill its through

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

#Include <File.au3>

$FileList=_FileListToArray(@DesktopDir)
If (Not IsArray($FileList)) Or (@Error=1) Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf

for $x = 1 to $FileList[0]
MsgBox (0,"",$FileList[$x])
next

wrote on screen... not tested

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

1 Prob it only shows 1 instead of doing untill its through

Simple solution to that:

For $i = 0 to ubound($arr, 1) - 1
msgbox(0,$i & " of " & ubound ($arr, 1) - 1,$arr[$i])
next

Now you can tell if it's really only doing 1 instead of multiple, or if it only had 1 to do, and thus was an issue somewhere else.

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