How to write to a file by reading another file and making some changes in it
<p>Hi, I am trying to read a text file and then writing the read data to a new file in Java by changing some fields in data read from the first file. I am stuck here: I can read file but the selective modification is very difficult, I can not understand how to modify particular part of the line in a file? The text file is details.txt, and its contents are like:</p>

<p>peter,New York,2331.32</p>

<p>walsh,California,3224.43</p>

<p>and so on. Now, I want to modify the double values with an array containing the updated values like following:</p>

<pre><code>Double[] updatedValues = {33231.23,32344.34};
</code></pre>

<p>Can anybody please tell me how to update the double values by reading the values from array and writing those values to a new text file?</p>
