martin2k

Google
 
Web www.martin2k.co.uk

How do I search for files and replace strings within them?


 

Home

Read and add posts to the Visual Basic 6.0 Forums

Download some of my programs and OCXs

Read the Tips here

The old style forum is still available here

Contact


 

Question

From: reena
Date: Wednesday 25 July 2001 12:30 PM
Subject: looping within folder-sub folder-files
Question: martin,
received your reply. but now my problem has changes a bit which is as follows-
i have a folder which contain many folder as well files within it. i want that when i give search-replace critieria it should open the main folder and then open the sub-folder, this sub-folder may contain sub-folder's in it. i want that i can open the files in the sub-sub-folder search for some text in the file and replace it with other text. after finishing this it should go to the next file in the sub-sub-folder and repeat the same search-replace critieria. after doing this , it should return to the next sub-folder in the folder and again repeat the same thing. hope you understand what i mean to say.please reply soon.

Answer by Martin Allen:

I have created a project that will allow you to do this - see project 3 at the Projects page.

When you open the project, you can change the path and filetypes that are searched.

I hope that this will solve your problem.


Please fill in the below form if you have any comments or additional information you want to add about the above information.  If you have any Visual Basic 6.0 questions, please visit the ForumAny questions sent using this form will be ignored.

* - Mandatory

*Name: E-mail:

*Comments:

*Please type the following code (your comment will not be accepted without it):


Martin Allen 1999 - 2007.  Last updated Wednesday 21 February 2007 06:38:22 PM -0000.