Can somebody please teach me how to edit existent files with java? I just need basics like how do you add lines to a file, search lines in a file and delete lines in a file.
If you guys give me a guide i will waste a lot of time i don't have trying to understand it because i am terrible at understanding guides so if you please want to help me just write me out few lines of codes and say how it works.
-thank you
this is what i use to create new files.
File userFileLog = new File(userFileId); if(!userFileLog.exists()) { PrintWriter output2 = new PrintWriter(userFileLog); output2.print("Text"); output2.close(); }
so what do i do if the file does exist? I need to add some lines and remove some from that file.