Editing properties files w/o losing formatting
<p>I have a properties (Java world) file with comments and key=value. I simply want to take backup of the file and edit few key=value. I need to edit the key in loop as the number of keys are not fixed and also the key names differ partly which is not a problem, but i am struggling to know how to maintain the format of the file (comments, spaces)?</p>

<pre><code> # ABC System Admin Database
       abc_jdbc.password=5667P7JiL7k221j+DmnVQ==

 # XYZ System Admin Database
       xyz_jdbc.password=489slP7JiL7k221j+LmnVQ==
</code></pre>

<p>and so on......</p>
