![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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 |
#9
| |||
| |||
|
|
Is it an efficiant way to do it? Is there a component for doing so besides FSO. |
#10
| |||
| |||
|
|
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") |
![]() |
| Thread Tools | |
| Display Modes | |
| |