Falk2
asked on
Dir Function -> get all *.TXT in a folder and there subfolders
Hi!
is there an easy way to get all *.txt in a folder (e.g. C:\Programs) and then get from this folder all subfolders with have *.txt with the function DIR?
Falk2
is there an easy way to get all *.txt in a folder (e.g. C:\Programs) and then get from this folder all subfolders with have *.txt with the function DIR?
Falk2
Uhm, should've also said:
it will write the contents to mytextfile.txt
regards,
CJ
it will write the contents to mytextfile.txt
regards,
CJ
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For an example that searches subdirectories for files matching a pattern (*.txt, etc.), look at:
http://www.vb-helper.com/howto/search.zip
For an example that does the same thing but uses the API instead of VB's Dir function, look at:
http://www.vb-helper.com/howto/search.zip
This version is faster but more complicated.
For some other interesting examples, go to:
http://vb.digitalroutes.co.uk/index.shtml?file+search
These examples do things like search subdirectories for files that contain a certain string or search for .doc files that contain a certain string.
http://www.vb-helper.com/howto/search.zip
For an example that does the same thing but uses the API instead of VB's Dir function, look at:
http://www.vb-helper.com/howto/search.zip
This version is faster but more complicated.
For some other interesting examples, go to:
http://vb.digitalroutes.co.uk/index.shtml?file+search
These examples do things like search subdirectories for files that contain a certain string or search for .doc files that contain a certain string.
ASKER
thanks
work very fine :)
Falk2
work very fine :)
Falk2
dir/s *.txt -> MyTextFile.txt
Regards,
CJ