473,671 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

search file that containing especific text

Hi,

I need to seach all files in a folder that contain an specific text.

Thanks

Boris
Nov 20 '05 #1
5 1327
RDI
Why not just do it in explorer? Or did you need to have one of your
functions do something on these files?

Not sure if there's a better way in VB.net but you COULD have a function
execute the dos level command "Find" and have it send it's output to a text
file. Then it's a simple matter of parsing the text file to get a list of
files that meet your requirements.

"Boris Bulit" <bu****@bellsou th.net> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Hi,

I need to seach all files in a folder that contain an specific text.

Thanks

Boris

Nov 20 '05 #2
RDI
Why not just do it in explorer? Or did you need to have one of your
functions do something on these files?

Not sure if there's a better way in VB.net but you COULD have a function
execute the dos level command "Find" and have it send it's output to a text
file. Then it's a simple matter of parsing the text file to get a list of
files that meet your requirements.

"Boris Bulit" <bu****@bellsou th.net> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Hi,

I need to seach all files in a folder that contain an specific text.

Thanks

Boris

Nov 20 '05 #4
* "Boris Bulit" <bu****@bellsou th.net> scripsit:
I need to seach all files in a folder that contain an specific text.


Code for file enumeration:

<http://www.mvps.org/dotnet/dotnet/samples/filesystem/downloads/RecursiveFileSc an.zip>

Have a look at the classes in the 'System.IO' namespace, namely
'BinaryReader' and 'StreamReader' to read the contents of the files.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4199
by: Alastair | last post by:
Hello guys, I've been building a search facility for an intranet site I'm part of developing and we've been building a search engine using Index Server. It mostly works, however there have been a few niggling problems and fixing it seems to be a case of patching errors as we find them so I'm thinking that it might be worth starting the logic from scratch and rebuilding this again. Basically we have a simple search, which is simply a...
0
280
by: Boris Bulit | last post by:
Hi, I need to seach all files in a folder that contain an specific text. Thanks Boris
2
4597
by: richardkreidl | last post by:
I want to be able to delete and search for elements in a XML file, I'm using the code below for adding elements which works great: Public Sub cmdAddElement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddElement.Click Dim doc As New XmlDocument doc.Load("c:UMZ.xml") Dim root As XmlNode = doc.DocumentElement
3
9549
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and MusicAlbum let you find MP3 and other music files based on the singer and album name; DocAuthor let you find Office documents created by a certain user; DocAppName let you find files of a particular program, and so on. Indexing Service uses plug-ins...
13
1908
by: Ray Muforosky | last post by:
Hello all: Task: I want to do file search, using the "conatining text" option from a web page. How do I search for a file on my local drive containing a certain string, from a web page. That is, how do run the windows search program from a web page. Any help will be appreciated.
5
2687
by: Mark | last post by:
Hi I have an application (in vb.NET 2005) which holds data in SQL Server and some of the SQL records are simply paths to related files. I would like to be able to do a text search on both the SQL data and the contents of any referenced files. The returned list being a listing which includes both records containing the text and files containing the text. Does anyone have a simple example of programatically searching for files
13
5974
by: Vai2000 | last post by:
Hi All, Planning to call the same search API which windows Search uses for searching , when u launch with Ctrl+F,you have the flexibility to provide a containing text! VB/C# any thing would work My search wants to use Containing text Thanks Preferred OS:Win2k3
3
3546
by: =?Utf-8?B?UGVycmlud29sZg==?= | last post by:
Not sure where to post this... Found some interesting behavior in Windows Search (Start =Search =All files and folders =search for "A word or phrase in the file:"). This applies to XP and maybe other Windows flavors. Procedure: 1. Create a simple text file named test.txt. 2. Open the text file in a text editor and add a simple test word such as "blah" (not quotes).
0
10753
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
8485
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8403
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.