Bob,
Great to see another Senior Enlisted!
Maybe if I start from ground zero, it will help. I'm parsing messages out of Outlook. The parser stores the file to parse as an object, then I have a Public Sub that looks within each object for specific lines. Once it finds that specific line to parse, which ends in a "//", it then passes the line to parse to a line specific function which strips the specific data fields and appends them to applicable tables within the db.
The whole thing works fine if the line has a very unique set name, but some of the messages have lines that simply start with one letter. In the previous examples, a P. Below is an example of one unique line:
MSGID/MSG TYPE/SENDER/SERIAL #//
So in this case, I have the parser use InStr(strFileToParse, "MSGID/") and a delimiter function to find the "//" to grab the specific line. Then I pass that line to a function that will pull out the specific items after each individual "/". In this case I send the MSG TYPE, the SENDER and the SERIAL # to a table. After some reverse engineering, this is easy.
The hard part is single letter lines, such as S/, P/, E/ etc... In the above example line, the second field ends in E/. So if I was parsing with my InStr method above simply using "E/", it would grab the E/ and all after that to the "//", although from the wrong set, because it exists previous to the real E/ line I want later in the message.
So I started trying to find ways to grab more from the line I want to parse. So if the E/ lines always looks like this: E/BROWN/FOX/, I could simply adjust my InStr statement to include all of that. I don't have that option with my P line.
It is always like this: P/(either a "-" or a single number)/#####(4 - 5 digit number)/
For example: P/1/5555/-/-/-/-/-/-// (the other dashes here represent other fields of data that may be populated in this line, but are unimportant to discuss at the moment but get stripped from the line after parsing.
Either way I just want it to look for that routine, hopefully with some kind of wildcard routine, and capture that line so I can then strip the specific sets. Using P/ isn't working, so I have to move to the right a little bit to ensure I get the right line for post parsing data stripping.
That help Bob?
Thanks Again Shipmate!!