Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] User Tips, Tricks and Samples (https://www.kinook.com/Forum/forumdisplay.php?f=19)
-   -   Suggestion needed for updating .bld file (https://www.kinook.com/Forum/showthread.php?t=4761)

CREvans 01-20-2011 11:10 AM

Suggestion needed for updating .bld file
 
Have an interesting scenario where I'm wanting to parse a VBPro .bld file and for every vbscript step, check for the instance of a given line and if that line is present, to put a new line just below it, while maintaining the original line. Like this:

Original:

Line 1
Line 2
Line 3

Desired output, with "Line 2" as the instance line:

Line 1
Line 2
Added Line
Line 3

It looks like the search/replace function isn't going to do what I want, since that will replace the existing line, not add a line after it. I don't know if this is possible from within vbpro itself, or if I'll need to develop something external to parse the .bld file.

Thanks in advance!
Scott

kinook 01-20-2011 11:48 AM

1 Attachment(s)
You should be able to use the object model for that. See the attached sample.

CREvans 01-20-2011 03:43 PM

That almost does what I need, but I'm actually only looking for a substring of the whole line, so what I actually need is:

Original lines:
ABCDE
FGHIJ
KLMNO

Search for FG

Final lines:
ABCDE
FGHIJ
PQRST
KLMNO

I'm sure I'm just mangling the regexp syntax and there should be an easy solution within the searchandreplace.bld framework that's you've already provided, I'm just not able to figure it out.

Scott

kinook 01-20-2011 03:55 PM

1 Attachment(s)
See attached.

CREvans 01-20-2011 04:07 PM

Works perfectly! Thanks a ton!


All times are GMT -5. The time now is 06:43 PM.


Copyright © 1999-2023 Kinook Software, Inc.