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 03-29-2004, 10:11 AM
chaoconnor chaoconnor is online now
Registered User
 
Join Date: 02-25-2004
Posts: 8
Replace in File

Good morning! The regular expression
<xml xmlns:[^*]*<rs:data>
works fine in PowerGREP and other Regular Expression editors, but not in Visual Build Pro. I keep getting:
Error expanding macros in property Find: <xml xmlns:<Error at Line 1, Column 1 (Syntax error)
Code: ^*>

Does Visual Build Pro use some sort of variation of Regular Expressions? Some background, I have a block of text that always starts with <xml xmlns: and always ends with <rs:data>, I need to find that block of text and replace it with a standard XML header.

Thank you!
Reply With Quote
  #2  
Old 03-29-2004, 02:20 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
You need to double up the [ and ] symbols: <xml xmlns:[[^*]]*<rs:data>

See this note in the Replace in File Action help file entry:
<snip>
Note: Bracket characters [ ] and percent sign % characters within this field must be doubled up (just as in any other field), since these are normally interpreted by Visual Build Pro as referencing script code and macros within a field.
</snip>

Kevin
Reply With Quote
  #3  
Old 03-29-2004, 03:47 PM
chaoconnor chaoconnor is online now
Registered User
 
Join Date: 02-25-2004
Posts: 8
Ahh... Gotcha! Thanks, I must have completely missed that line in my readings.

One other quick question that seems to be more difficult than it should be. After the find and replace from the previous question is done there are three seperate files (there were three seperate files before hand and the search is run on each of them) Now basically what I want to do is copy the contents of each of those files to one file. What's the best way to go about this? Find and replace seems to just over-write the file, I guess what I need is something with append abilities.

Thank you!
Reply With Quote
  #4  
Old 03-29-2004, 04:00 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
You could interate over each file processed with a Process Files step, and use a Write File step to append each file's contents to a new file (put [vbld_FSO.OpenFile("%PROCFILES_FULLPATH%").ReadAll]
in the 'Text to write to file' textbox). Make sure you check the 'Append to File' checkbox.

Hope this is clear enough. If not I can provide a sample...

Kevin
Reply With Quote
  #5  
Old 03-29-2004, 04:22 PM
chaoconnor chaoconnor is online now
Registered User
 
Join Date: 02-25-2004
Posts: 8
Thanks for the reply.

So I put a process file step in, which iterates through the three files. Beneath that step and one over I put a write file to the single file I'm trying to write with append checked off. I put [vbld_FSO.OpenFile("%PROCFILES_FULLPATH%").ReadAll] in the Text to write box, but I get the following error message:

Error expanding macros in property Text: <Error at Line 1, Column 1 (Object doesn't support this property or method: 'vbld_FSO.OpenFile')>

The macro does read as the correct file name, just FYI. Any ideas? Thanks again!
Reply With Quote
  #6  
Old 03-29-2004, 04:25 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
oops, I didn't test my reply very well, it should have been .OpenTextFile(), not .OpenFile()...

Let me know if that doesn't work for you..

Kevin
Reply With Quote
  #7  
Old 03-29-2004, 04:30 PM
chaoconnor chaoconnor is online now
Registered User
 
Join Date: 02-25-2004
Posts: 8
Thank you! That did the trick! I appreciate all your help today!
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 10:28 PM.


Copyright © 1999-2023 Kinook Software, Inc.