View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Why the heck doesn't this work?

On Tuesday, June 4, 2019 at 12:49:58 AM UTC-7, GS wrote:
The file data.txt contains the following string:
(There's a tab char just after the a123)

a123 A. BC #123


Oh.., now you tell us! Any other *very important details* like this we need
to know?


Hi Gary! I've been busy with some stuff, but I'm going to test your
latest code soon and see how it works.

Regarding the *very important details*, I can explain that. Here goes:

I believe I did provide sufficient details in my earlier posts. In
my first post titled "Tricky regular expression", I explained that I was
looking for "the first set of whitespaces that occur in the line".


Technically speaking, I should have caught that the 1st occurance of white
space was in fact the TAB character but coming into play after Claus' reply I
focused on the SPACE character instead, and so took it as 4 of those.

What you should have explained more accurately is the EXACT structure of the
data being parsed due to the numerous ways to create character spacing and/or
how new lines of text occur. (Assumes you have/had knowledge of the data
structure<g)

In the latter case, my code delimits the multi-line text file using the
CarriageReturn+Linefeed character combo because that's how I structured the
file. Your multi-line file may be structured differently and if so the code
will not work; - You'll need to test for which new line character is used:

vbCr (carriage return)
vbLf (linefeed) **most common

Also, I figured that once you provided any solution,I could easily tailor
it to work with files containing one input line or multiple lines.

So, I'm going to test your code soon and see how it goes. Thanks again
for your help!

8)


--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion