Function to read text file; find string; delete same before import

  • Thread starter Thread starter EagleOne
  • Start date Start date
I don't use regex to be effective. But I can copy and paste (and struggle while
debugging!).
 
I don't use regex to be effective.
should have been:
I don't use regex enough to be effective.

Using regex can be very effective!
 
Using regex can be very effective!

But they can often require a **lot** of trial and error coding to get them
"exactly right".

Rick
 
In your reply you commented "if you have the stand-alone (compiled) Visual Basic program available
(Version 6 only because of the use of the Replace function." This reminded me of compiling "macro
project" into a .DLL which is much more "secure" than a VBProject password; at least that is what I
heard.

All that said, I cheched the price for VB6, about $600, and read that it is essentially orphaned
(not sold by MS) in favor of .NET.

Are there any alternate choices to secure VBA?

TIA EagleOne
 
Good point! I tried and found myself doing quite a **lot**. One has to use Regex all the time to
do it quickly like Ron Rosenfeld seems to do/be.
 
Dick,

The Function solution has arrived, Thanks.

What are your thoughts as to the below solution as opposed to the Regex?

My point being, that RegEx is probably the best for HUUUUGH files but begs the next issue - RegEx
Reference libraries.

I'm not a regex expert, but that never stops me from giving my opinion. For
me, regex is great when you have a lot of possible strings that can be
distilled down to a few patterns. If you want to delete all the phone
numbers from a text file, my solutions falls flat while regex is the perfect
solution. But for your situation, with only three possible strings, regex
seems like overkill.
 
Dick Kusleika said:
I'm not a regex expert, but that never stops me from giving my opinion. For
me, regex is great when you have a lot of possible strings that can be
distilled down to a few patterns. If you want to delete all the phone
numbers from a text file, my solutions falls flat while regex is the perfect
solution. But for your situation, with only three possible strings, regex
seems like overkill.
 
Thanks Dick.

A few times I attempted to get my mind around RegEx and found it not very intuitive. Of course I
said that about VBA at one time.
 
I guess I do not appreciate the relative cost issues. All I want to do is compile my VBA code into
a DLL. It is quite possible that $600 is worth it.
 
You can't compile into a dll with VBA, but I believe with FreeBasic you can
and it is free.
Must admit though I have never done it as I have VB6.

RBS
 
Back
Top