Re: help parsing a string
Probably Regular Expressions will be the best. I have only used it twice and it seems to be very flexiable in what it can do.
Is your app outputting the file?
Re: help parsing a string
Quote:
Originally Posted by RobDog888
Probably Regular Expressions will be the best. I have only used it twice and it seems to be very flexiable in what it can do.
Is your app outputting the file?
Yeah it is, then another app I'm writting parses it.
I'll look at regular expression and see how to use it (them)
thanks
kevin
Re: help parsing a string
since your app writes the file then wouldnt it be easier to write it out in a easier format for you to read in? or maybe another file
for parsing only and not the user?
Re: help parsing a string
yeah it would be, but the format is already in use by others and would be a terrible pain to change everything else. You know, it's the boring details...it always comes down to details.
kevin
Re: help parsing a string
I thought about that too, but if you were to write out a duplicate file customized to your parsing needs then that will possibly
save you some headaches. :)
Re: help parsing a string
Quote:
Originally Posted by RobDog888
I thought about that too, but if you were to write out a duplicate file customized to your parsing needs then that will possibly
save you some headaches. :)
unfortunatley that create other headaches :(
I have it working using instr like this (with a small output file mod)
VB Code:
's= OutputFile.txt
Const rConst As String = "C:\ Volume Number:"
Dim iStart As Integer = InStr(s, rConst)
istart += rConst.Length
Dim iEnd As Integer = s.IndexOf(vbCrLf, iStart)
Dim myNum As String = s.Substring(iStart, iEnd - iStart).Trim
but I would rather use a RegEx but this doesn't work
VB Code:
Const rConst As String = "C:\ Volume Number:"
Dim r As New System.Text.RegularExpressions.Regex(rConst)
Dim iStart As Integer = r.Match(s).Index
iStart is always 0. How come? I suspect I'm not using RegEX correctly
:confused:
thanks
for the help Rob
kevin
Re: help parsing a string
There are codes that make up your search string. It looks like 1337. :)
Look here, I think this will here for the expression needed.