I have a large (around 50k+ lines). DAT file. I need to add one line before the last line in it.
When I am using:
Files.write(path, content.getBytes(StandardCharsets.UTF_8),
StandardOpenOption.APPEND);
It is appending line after the last line.
Is there any way I can insert the line before the last line?