-1

I have a gui program that stores user information, I want to create an edit capability, when they click on the edit button is it possible to change their info in the text file?

Edit: their info is being saved in a txt file, i want to know if i can edit that information without doing it manually.

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
adoba yua
  • 41
  • 7
  • You should ask more specific questions. Try Java tutorials first, learn to program in general, then ask questions :) This is for example another very basic but clear question: http://stackoverflow.com/questions/2885173/how-to-create-a-file-and-write-to-a-file-in-java – Hugo Zaragoza Jun 11 '16 at 06:48
  • I can program pretty well already, my question is how do I edit data that I have in a text file without doing it manually, I am using a filewriter, buffered writter etc to read data into a file, it saves but I want to know how i can edit the data. Thank You. – adoba yua Jun 11 '16 at 06:49
  • edit = load + modify + save – Hugo Zaragoza Jun 12 '16 at 15:19

1 Answers1

0

You need to iterate on each line, parse and save the values in a class. Then provide a GUI to make the edits. When you are done rewrite the text file (or better serialize the class) from the class. I hope i understood and answered your question

I would suggest using XML, i simplifies everything, plus you already have the API to deal with serialization and deserilization