Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA equivalent of findstr

Hi,

Can you help me with the VBA code equivalent of this command line:

findstr /M /G:c:\search\pattern.txt e:\data\activity*.DAT
R:\results\found_file_names.txt


whe
findstr = finds strings
/M = print only the filename if a file contains a match
/G = get the search strings from the file c:\search\pattern.txt
e:\data\activity*.DAT = search all the activity*.DAT files lik
activity1.DAT, activity2.DAT, etc.
R:\results\found_file_names.txt = this is the file that will contai

the results of the search (the results will be just the file names tha
contain the search string)

With this working, I need to load the results into a spreadsheet.

Appreciate it

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default VBA equivalent of findstr

In the debug window type instr( and read the popup

----- lothario wrote: -----

Hi,

Can you help me with the VBA code equivalent of this command line:

findstr /M /G:c:\search\pattern.txt e:\data\activity*.DAT
R:\results\found_file_names.txt


whe
findstr = finds strings
/M = print only the filename if a file contains a match
/G = get the search strings from the file c:\search\pattern.txt
e:\data\activity*.DAT = search all the activity*.DAT files like
activity1.DAT, activity2.DAT, etc.
R:\results\found_file_names.txt = this is the file that will contain

the results of the search (the results will be just the file names that
contain the search string)

With this working, I need to load the results into a spreadsheet.

Appreciate it.


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA equivalent of findstr

see the help on the filesearch object for a VBA method. There may be a
closer equivalent in one of the scripting libraries.

--
Regards,
Tom Ogilvy

"lothario " wrote in message
...
Hi,

Can you help me with the VBA code equivalent of this command line:

findstr /M /G:c:\search\pattern.txt e:\data\activity*.DAT
R:\results\found_file_names.txt


whe
findstr = finds strings
/M = print only the filename if a file contains a match
/G = get the search strings from the file c:\search\pattern.txt
e:\data\activity*.DAT = search all the activity*.DAT files like
activity1.DAT, activity2.DAT, etc.
R:\results\found_file_names.txt = this is the file that will contain

the results of the search (the results will be just the file names that
contain the search string)

With this working, I need to load the results into a spreadsheet.

Appreciate it.


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you use the equivalent of NOT in text? Matt Excel Worksheet Functions 2 January 25th 10 05:29 PM
EQUIVALENT for this FORMULA , please ytayta555 Excel Worksheet Functions 1 July 3rd 08 10:25 PM
equivalent for function , please for help ytayta555 Excel Worksheet Functions 5 April 21st 08 02:03 AM
Maxif equivalent Fred Smith Excel Worksheet Functions 6 December 10th 06 03:58 AM
Lotus Equivalent Brian Keanie Excel Discussion (Misc queries) 6 January 2nd 05 10:48 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"