View Single Post
 
Old 02-06-2016, 04:30 AM
PRA007's Avatar
PRA007 PRA007 is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

Problem is not in opening file, reading it line by line and doing regex. Real problem starts after that.

For example I am getting by any means, StrTxt as string which contains multiple lines or I don't know how string behaves inside object. As far as my problem concerns I get StrTxt from two souces.

1. by opening a file.

2. from httprequests.

In both the case I end up with StrTxt as string.

So the question is, If My StrTxt contains multiple occurrences of a string like "string", how to get all of it.

For example in hypothetical string.

Code:
StrTxt = "mmrkxyz" & vbCr & "mmrkyzx" & vbCr & "xyz" & vbCr & "yzx" & vbCr & "mmarkxxx"
Now I Just want to get all the lines that have initial mmrk as string like this, so that I can further process it.

Code:
StrTxt = "mmrkxyz" & vbCr & "mmrkyzx" & vbCr & "mmarkxxx"
I don't know how to better explain this, but I can not find any answer of this.

To make it simple, My strings contains multiple lines. I just want it to reduced to lines that contains specific characteristics like Left(StrTxt, 4) = "mmrk".
Reply With Quote