Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Files From Specified Directory 1

Status
Not open for further replies.

aaiqbal

Programmer
Sep 15, 2003
26
US
Hi Again,
It's me, Abdul. I want to thank all of the helpful people out there who have made my job easier. I have another question. I wanted to know how to open a folder and then read one file at a time, do something with that file, then do the same thing with the rest of the files. For instance, what if I want to automate transferring files from one folder to another? And instead of going into the folder, copying all of the files, then pasting them is the desired folder, I want to specify the two folder paths in a script and automate the transfer. How would I do this? I know fopen is used to open a file, but can it also be used to open a directory (folder)?
 
You can use the findfirst command to select a file matching a filemask (*.*, *.txt, etc.) in the given directory, then use while findnext to keep processing additional files that match the same criteria. There is a sample script in the discussion of the findnext command in the ASPECT help file that shows how to do this.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top