Replace first line of a text file in Java

后端 未结 5 2037
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 03:18

I have a text file where I want to change only the first line of the file. The file could be millions of rows long, so I\'d rather not have to loop over everything, so I\'m

5条回答
  •  爱一瞬间的悲伤
    2020-12-11 03:53

    Why not write a Perl script and invoke it using Runtime.exec(). Not a pure java solution though. Also have a look at this article before going deep http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

提交回复
热议问题