#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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! |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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! |
#6
|
|||
|
|||
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 |
#7
|
|||
|
|||
Thank you! That did the trick! I appreciate all your help today!
|
|
|