Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Search for txt in Files

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,62124
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Search for txt in Files
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Search for txt in Files - 7/2/2008 6:36:11 AM   
  djredmar


Posts: 60
Score: 0
Joined: 12/11/2006
From: Europe, The Netherlands
Status: offline
hi!

I needed to find some text in some folder; so wrote the script.

quite fast written, so no debug info / neat code etc.

maybe in the future i will update the script to scan for subfolders / extenstions etc.


Here's the code!

      

_____________________________

blah?
 
 
Post #: 1
 
 RE: Search for txt in Files - 7/3/2008 12:33:24 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Thanks for sharing the code, but wouldn't it be easier to just use Find? Or my most recent favorite, powershell and Select-String?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to djredmar)
 
 
Post #: 2
 
 RE: Search for txt in Files - 7/3/2008 3:27:54 AM   
  djredmar


Posts: 60
Score: 0
Joined: 12/11/2006
From: Europe, The Netherlands
Status: offline
find option didn't gave me results....

I don't know why; i search for *.py with txt, but no results.

in my favorite editor is the same option, not working... my script? spontaniously works? :D

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Search for txt in Files - 7/3/2008 5:11:46 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Glad you got what you needed.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to djredmar)
 
 
Post #: 4
 
 RE: Search for txt in Files - 7/4/2008 7:16:04 AM   
  DiGiTAL.SkReAM


Posts: 1170
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
quote:

ORIGINAL: djredmar

find option didn't gave me results....

I don't know why; i search for *.py with txt, but no results.

in my favorite editor is the same option, not working... my script? spontaniously works? :D


I agree the windows gui Find/Search for Files util is a waste of pixels.
I personally prefer using findstr.exe at the dos prompt.

findstr /m /i /s /c:"the string to search for" *.py

The above command would return the filenames of any .py files that contain the string to search for, including any in subdirectories as well, and the search would be non-case-sensitive.
As a side note, Findstr can also perform searches on regular expressions.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to djredmar)
 
 
Post #: 5
 
 RE: Search for txt in Files - 7/9/2008 10:31:43 PM   
  TomRiddle


Posts: 174
Score: 4
Joined: 2/7/2008
Status: offline
Making an HTA front-end for Findstr that can be added to explorer right click contex menu might be a cool and useful script.

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 6
 
 RE: Search for txt in Files - 7/12/2008 5:34:22 PM   
  DiGiTAL.SkReAM


Posts: 1170
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
When will that be done?  It sounds cool...

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to TomRiddle)
 
 
Post #: 7
 
 RE: Search for txt in Files - 7/13/2008 11:02:30 AM   
  TomRiddle


Posts: 174
Score: 4
Joined: 2/7/2008
Status: offline
Sounds like a challenge.

I am not a gunna guy. So I won't say I gunna do it, there are some bits that I have not tried doing before, but I will say I am gunna have a try.

EDIT: Here you go http://www.visualbasicscript.com/fb.aspx?m=62419

< Message edited by TomRiddle -- 7/16/2008 1:04:18 AM >

(in reply to DiGiTAL.SkReAM)
 
 
Revisions: 1 | Post #: 8
 
 RE: Search for txt in Files - 8/17/2008 7:26:17 PM   
  djredmar


Posts: 60
Score: 0
Joined: 12/11/2006
From: Europe, The Netherlands
Status: offline
If i have some time today i will try to make an little front-end for findstr

edit: to less experience.... skipping

< Message edited by djredmar -- 8/17/2008 7:44:17 PM >

(in reply to TomRiddle)
 
 
Revisions: 1 | Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Search for txt in Files Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts