I have a .dat file with many lines. I need to overwrite a certain line. Let's just say I have to overwrite the 5th line of the dat file. How would I set the RandomAccessFile to overwrite at line 5 (or any line in general)? (P.S.: each line has 10 characters, if that helps)
Recommended Answers
Jump to PostI remember a discussion about this on Daniweb before. You might want to do a search for it. But I'm pretty sure the only way to do what you want is to read the file, delete it, and write what you want the file to be back to the same …
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.