D4rk^S0ul Posted March 8, 2006 Share Posted March 8, 2006 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? Link to comment Share on other sites More sharing options...
cdkid Posted March 8, 2006 Share Posted March 8, 2006 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! Link to comment Share on other sites More sharing options...
D4rk^S0ul Posted March 8, 2006 Author Share Posted March 8, 2006 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? Link to comment Share on other sites More sharing options...
cdkid Posted March 8, 2006 Share Posted March 8, 2006 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! Link to comment Share on other sites More sharing options...
D4rk^S0ul Posted March 8, 2006 Author Share Posted March 8, 2006 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 Link to comment Share on other sites More sharing options...
Valuater Posted March 8, 2006 Share Posted March 8, 2006 (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 March 8, 2006 by Valuater Link to comment Share on other sites More sharing options...
greenmachine Posted March 8, 2006 Share Posted March 8, 2006 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now