save properties file without affecting existing comments.
posted 5 years ago
I have a properties file filled up with comments about the key value pair, followed by key value pair.
If, i edit the some key values and save the file, all my comments are lost.
Is there any way to save the new key values with original comments.
I think that the OP is referring to the store() method which writes a file in (probably) hash order and drops any of the original comments. I ended up writing my own Properties work-alike class using a LinkedHashMap to get around this issue.
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.