dbTalk Databases Forums  

ActiveX to find files containing an specific word

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss ActiveX to find files containing an specific word in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RayAll
 
Posts: n/a

Default ActiveX to find files containing an specific word - 03-11-2005 , 01:09 PM






Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package .I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks




Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-11-2005 , 01:58 PM






Using the FSO, open the file, read the data and just use InStr to find the
word.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"RayAll" <RayAll (AT) microsft (DOT) com> wrote

Quote:
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package
..I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks






Reply With Quote
  #3  
Old   
RayAll
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-11-2005 , 02:09 PM



Is it an efficiant way to do it? Is there a component for doing so besides
FSO.

Thanks for your help.

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
Using the FSO, open the file, read the data and just use InStr to find the
word.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:eN17L3mJFHA.3420 (AT) tk2msftngp13 (DOT) phx.gbl...
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package
.I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object
deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks








Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-11-2005 , 02:51 PM



I'd say no it is not very efficient at all, but then I don't know of a
better way. Really some form of full text index technology would make more
sense. MS Index Server? Maybe there is an API to access the OS file search
functionality, never really looked.

"RayAll" <RayAll (AT) microsft (DOT) com> wrote

Quote:
Is it an efficiant way to do it? Is there a component for doing so besides
FSO.

Thanks for your help.

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:OT%23p2TnJFHA.1176 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
Using the FSO, open the file, read the data and just use InStr to find
the
word.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:eN17L3mJFHA.3420 (AT) tk2msftngp13 (DOT) phx.gbl...
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package
.I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object
deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks










Reply With Quote
  #5  
Old   
Simon Worth
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-11-2005 , 03:06 PM



There's no way you can tell ahead of time what time file will be called? I
mean to say there are no naming conventions for the file you are looking
for?
I've never used the fso to search for strings, and I don't think a method
exists for the FSO to do that. You could probably figure out a way to use
the old DOS command FIND within an activeX script or a Execute process task,
and based on the return values determine if the file in question contains
the string your are looking for or not.

--
Simon Worth


"RayAll" <RayAll (AT) microsft (DOT) com> wrote

Quote:
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package
..I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks






Reply With Quote
  #6  
Old   
RayAll
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-11-2005 , 04:08 PM



I know what I'm looking for ,here is a batch file that can do it but I don;t
know how to get the result from batch file back to my vbscipt:
@echo off
if {%2}=={} @echo Syntax: MySearch File String&goto :EOF
setlocal
set file=%1
set string=%2
set string=%string:"=%
for /f "Tokens=*" %%f in ('dir %file% /B /S') do (
for /f "Tokens=*" %%t in ('type "%%f"^|FINDSTR /I /L /C:"%string%"') do (
@echo "%%f"
)
)
endlocal


thanks
"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
There's no way you can tell ahead of time what time file will be called?
I
mean to say there are no naming conventions for the file you are looking
for?
I've never used the fso to search for strings, and I don't think a method
exists for the FSO to do that. You could probably figure out a way to use
the old DOS command FIND within an activeX script or a Execute process
task,
and based on the return values determine if the file in question contains
the string your are looking for or not.

--
Simon Worth


"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:eN17L3mJFHA.3420 (AT) tk2msftngp13 (DOT) phx.gbl...
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package
.I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object
deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks








Reply With Quote
  #7  
Old   
The Margolins
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-12-2005 , 02:22 PM



RayAll,

In the batch file write the file names into a file and then read it in
ActiveX.

Ilya

"RayAll" <RayAll (AT) microsft (DOT) com> wrote

Quote:
I know what I'm looking for ,here is a batch file that can do it but I
don;t
know how to get the result from batch file back to my vbscipt:
@echo off
if {%2}=={} @echo Syntax: MySearch File String&goto :EOF
setlocal
set file=%1
set string=%2
set string=%string:"=%
for /f "Tokens=*" %%f in ('dir %file% /B /S') do (
for /f "Tokens=*" %%t in ('type "%%f"^|FINDSTR /I /L /C:"%string%"') do (
@echo "%%f"
)
)
endlocal


thanks
"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:eKK5n4nJFHA.2572 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
There's no way you can tell ahead of time what time file will be called?
I
mean to say there are no naming conventions for the file you are looking
for?
I've never used the fso to search for strings, and I don't think a
method
exists for the FSO to do that. You could probably figure out a way to
use
the old DOS command FIND within an activeX script or a Execute process
task,
and based on the return values determine if the file in question
contains
the string your are looking for or not.

--
Simon Worth


"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:eN17L3mJFHA.3420 (AT) tk2msftngp13 (DOT) phx.gbl...
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS package
.I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object
deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks










Reply With Quote
  #8  
Old   
ALI-R
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-13-2005 , 07:36 PM



No the batch file only gives you the name of the files which contain the
word,I don't know hot to connect it to my Activex code .That's the
problem:-)

"The Margolins" <margolin_no_spam_ (AT) optonline (DOT) net> wrote

Quote:
RayAll,

In the batch file write the file names into a file and then read it in
ActiveX.

Ilya

"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:uNCKgboJFHA.904 (AT) tk2msftngp13 (DOT) phx.gbl...
I know what I'm looking for ,here is a batch file that can do it but I
don;t
know how to get the result from batch file back to my vbscipt:
@echo off
if {%2}=={} @echo Syntax: MySearch File String&goto :EOF
setlocal
set file=%1
set string=%2
set string=%string:"=%
for /f "Tokens=*" %%f in ('dir %file% /B /S') do (
for /f "Tokens=*" %%t in ('type "%%f"^|FINDSTR /I /L /C:"%string%"') do
(
@echo "%%f"
)
)
endlocal


thanks
"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:eKK5n4nJFHA.2572 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
There's no way you can tell ahead of time what time file will be
called?
I
mean to say there are no naming conventions for the file you are
looking
for?
I've never used the fso to search for strings, and I don't think a
method
exists for the FSO to do that. You could probably figure out a way to
use
the old DOS command FIND within an activeX script or a Execute process
task,
and based on the return values determine if the file in question
contains
the string your are looking for or not.

--
Simon Worth


"RayAll" <RayAll (AT) microsft (DOT) com> wrote in message
news:eN17L3mJFHA.3420 (AT) tk2msftngp13 (DOT) phx.gbl...
Hi All,
Sorry if this question is more VBScriptish one.

I' trying to find an specifc file on my computer through my DTS
package
.I'd
like to give my DTS Package
a wild card(*.txt) and a word or phrase in the file (exactly like what
widows dose) and find the files on my computer.I know that FSO object
deal
with files but it dosen't find an specifc word inside a file,dose it?


Thanks












Reply With Quote
  #9  
Old   
Ryan Walberg [MCSD]
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-14-2005 , 02:53 PM



RayAll wrote:
Quote:
Is it an efficiant way to do it? Is there a component for doing so besides
FSO.
Use the Indexing Service API.

set oQuery = Server.CreateObject("ixsso.Query")
with oQuery
.Query = "wascally wabbits"
.Catalog = "c:\"
.SortBy = "rank[d]"
.Columns = "DocTitle, Directory, Filename, Rank, Characterization,
Path, VPath"
end with

set oRS = oQuery.CreateRecordSet("sequential")



Reply With Quote
  #10  
Old   
Simon Worth
 
Posts: n/a

Default Re: ActiveX to find files containing an specific word - 03-15-2005 , 04:01 PM



That's only if the index service is running though isn't it?

--
Simon Worth


"Ryan Walberg [MCSD]" <generalpf (AT) nospam (DOT) yahoo.reallynospam.com> wrote in
message news:eg$ifeNKFHA.2996 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
RayAll wrote:
Is it an efficiant way to do it? Is there a component for doing so
besides
FSO.

Use the Indexing Service API.

set oQuery = Server.CreateObject("ixsso.Query")
with oQuery
.Query = "wascally wabbits"
.Catalog = "c:\"
.SortBy = "rank[d]"
.Columns = "DocTitle, Directory, Filename, Rank, Characterization,
Path, VPath"
end with

set oRS = oQuery.CreateRecordSet("sequential")




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.