This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Need opinion / ideas... I need to take 2 files and merge them, but not in the normal way. I need to take a "production" properties file (yes, this is for a Struts Application) and merge it with the latest "Test/verification" version for movement to a production environment. Each file is about 2,000 lines long. My question is, should I: A> put each in an array and check them item by item putting the updated entries (as well as the unchanged entries) to a new file to be moved to the production file... B> put one of them in an array and read the other one, doing the same as above... C> Some other gee whiz magic / api class that I'm not aware of to put them together without a lot of overhead.... I can't just merge the files because of duplicates and such and I can't delete production and replace with test because all entries may not be present in either... Thanks..
I solved a problem very much like this one, but in a different way. Trying to do a smart merge of these files is going to really hard, and error prone. My solution was to have a single data file which contained configuration information for all environments. The information in this file was formatted so that there was a consistent way of defining things.
Than you have a seperate script/program which is able to generate the configuration file which is correct for any given environment. One advantage of doing things this way is that you are able to place the data file into source control. [ March 26, 2003: Message edited by: William Barnes ]
Please ignore post, I have no idea what I am talking about.