|
-
Jan 8th, 2016, 05:33 PM
#1
Thread Starter
Junior Member
Merge Two Text Files With No Duplication...
I have to merge two application config/settings files like the following...
File one is a configuration file already deployed on a users system and looks something like this, for example...
;TestingBS
;company.testing=BS
They commented out the company.testing value to suit their needs.
File two looks something like this. This is the file that will be included in an upgrade. Anything that matches in any way to File one should be left alone...
;TestingBS
company.testing=BS
;New Value
value.new=1
You'll notice that the first value in this file is not commented out, but that is not to be translated to the output file as the users current configuration is to be maintained. Also, any new values should be pumped to the new file. the resulting file should look like this...
;TestingBS
;company.testing=BS
;New Value
value.new=1
I've been trying a few things, but I can't get it quite right. If I do get the new value in the output, the company.testing appears both commented and uncommented.
Can anyone think of a quick way to do this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|