Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-21-2005, 03:26 PM
shaneras shaneras is online now
Registered User
 
Join Date: 10-22-2003
Posts: 3
Find and Replace in file

Hi,

I am trying to find the CLASSID in one .htm file and take than and inject into the CLASSID of another .htm file.

Example

Input file: ..\cb\res\cab\cbTunnelClientInstall_installing.htm

Output file: ..\cb\res\htm\cb_tray_installer.htm

I am trying to take this section of a line:

CLASSID='clsid:369FE6EB-69DB-417D-834B-278038CF1106'

out of cbTunnelClientInstall_installing.htm (the ID changes every time I install) and replace the number the cb_tray_installer.htm:

CLASSID='clsid:96528C60-A8B2-4212-B591-50EFF1252F6E'

I have searched around the forums but so far I have not found an example that works. Thanks for any help in advance!

Shane

P.S.
When I upgrade to 6.0 (using 5.6) will I need a new license? Want to upgrade so I can use Ant scripts but am concerned about downtime.
Reply With Quote
  #2  
Old 10-22-2005, 04:37 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See attached sample (requires VBP v6).

Yes, you will need to upgrade when going from VBP v5 to v6. See http://www.kinook.com/Forum/showthre...?threadid=1315 for details.
Attached Files
File Type: bld findreplclassid.bld (2.2 KB, 1748 views)
Reply With Quote
  #3  
Old 10-24-2005, 08:20 PM
shaneras shaneras is online now
Registered User
 
Join Date: 10-22-2003
Posts: 3
Thanks for the example, you guys have awesome suport. I also upgraded to VBP 6 and really like it so far.

The sample now finds and replaces the CLASSID, but it also munges part of the line. Here is how the line looks before I run the script:

<td width="0"><object id="cb_installer" CLASSID='clsid:AECFFAFD-0DB4-40C6-A9B4-3055D68A2E11' CODEBASE='/res/cab/cbTunnelClientInstall.cab#Version=1,00,0000' BORDER=0 VSPACE=0 HSPACE=0 ALIGN=TOP HEIGHT=0% WIDTH=0% ID="Object1" VIEWASTEXT></object></td>

And after I run the script:

<td width="0"><object id="cb_installer" CLASSID='clsid:AECFFAFD-0DB4-40C6-A9B4-3055D68A2E11'BORDER=0 VSPACE=0 HSPACE=0 ALIGN=TOP HEIGHT=0% WIDTH=0% ID="Object1" VIEWASTEXT></object></td>

For some reason I can't figure it is removing this from the line:

CODEBASE='/res/cab/cbTunnelClientInstall.cab#Version=1,00,0000'

If I try and put the whole line in and then try to replace the CLASSID I get this error:

Error expanding macros or script in property Find: <Error parsing macros: Unrecoverable Parse Error at position 176 - expecting macro_name>

Thanks for the help :-)

Shane
Reply With Quote
  #4  
Old 10-24-2005, 09:45 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
Not sure, it works fine here.

The error you reported is probably due to the need to use %% instead of % in the text you were testing with as the % symbol is used to specify a macro name.

Attached is the same example (slightly modified with your sample text) demonstrating the correct replacement behaviour with your actual text.
Attached Files
File Type: bld findreplclassid.bld (2.6 KB, 1919 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:59 AM.


Copyright © 1999-2023 Kinook Software, Inc.