GREP in VBA

G

Gary's Student

Does any one know of an implememntation of the UNIX GREP command in Excel
VBA? I need to interpret GREP commands and perform any required file piping.

Thanks in Advance
 
J

JE McGimpsey

Don't know if there are any VBA implementations of grep, but if you're
using MacXL, you can take advantage of MacOS being Unix-based to use the
built-in MacScript() method to run an Applescript string which calls the
Unix shell: do shell script "grep expr file", e.g.:

Dim str As String
str = MacScript("do shell script ""egrep 'ab|cd' fname""")
 
G

Gary's Student

Thanks for your reply. I may be forced to look at the C code for GREP.
Sadly i suspect that,in this case, plagerism is no less work than doing it
myself.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top