Jump to content

Do something all all files in directory


leuce
 Share

Recommended Posts

G'day everyone

I would like to be able to drag a folder tree to a compile AutoIt script and let the script open all TXT files in that tree in my text editor. Dragging and dropping is not a problem. Opening in the text editor is not a problem. But how do I get a directory listing of the files, or how do I tell the script which files to process?

In MS Windows I would right-click the folder and search for *.TXT, to get a list of all text files in it. But I don't know how to effect that in AutoIt.

Any ideas about how to do this?

Thanks

Samuel

Link to comment
Share on other sites

Look in the helpfile at the example for FileFindFirstFile & FileFindNextFile. Just a small bit of tweaking should make it possible to open them.

~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

.... how do I get a directory listing of the files, or how do I tell the script which files to process? .... and search for *.TXT, to get a list of all text files ...

The Help file can tell you more about the following functions. See if any of them will work for you.
  • _FileListToArray()
  • FileOpenDialog()
  • FileFindFirstFile()
  • StdoutRead()
  • Run(@ComSpec & " /c dir ...)
If you search the Help file or forum for keywords like "directory listing of files" and come up with nothing, you can always simplify or broaden your search with a single keyword like "files". Hope this help get you in the right direction.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...