This question already has an answer here:
- Modify a .txt file in Java 11 answers
I need some help or code examples to update an existing line.
File contents:
Heinrich: 30
George: 2020
Fred: 9090129
Say if I wanted to update (write) George's value to say 300, how would I achieve this?
EDIT: Or would it be better off just using YAML?
Thanks.
Here is a way to do it, try it. In this example the file is C:/user.txt and i change the value of George by 1234
This is a working solution, but i think there is some other way more efficient.