Page 1 of 1

File editing question...is this possible?

Posted: Tue Aug 29, 2006 6:07 pm
by cptlo306
I need to edit an existing xml file during the installation process. I'm aware of the EditFile plugin but I don't think it'll work for this.

The file I need to modify is part of the Microsoft SQL Reporting Services installation (rssrvpolicy.config - copy is attached also).

I need to add about 9 lines of text in a certain place in the file like this:

PublicKeyBlob="00240...shortened for this post"
/>
</CodeGroup>

****NEW LINES WOULD GO HERE*****

</CodeGroup>
</CodeGroup>
</PolicyLevel>
</policy>
</security>
</mscorlib>
</configuration>

(not sure the above will line up right...the attached file shows it better).

Does this make sense? Is this possible without writing a custom vbscript or similar?

Thanks.

File Attached:

rssrvpolicy.config

File Attached:

rssrvpolicy.config.txt

Posted: Tue Aug 29, 2006 6:37 pm
by MichaelNesmith
You could use looping constructs and Read from Text File, Write to Text File commands, along with If for determining when you're at the end of the file and at the insertion point, to get this done.

Basically, read from the original file, write into a copy, add the extra text into the copy, and continue reading from original file until it ends; then replace the original with the copy.