javafiletext

Writing in the beginning of a text file Java


I need to write something into a text file's beginning. I have a text file with content and i want write something before this content. Say i have;

Good afternoon sir,how are you today?
I'm fine,how are you?
Thanks for asking,I'm great

After modifying,I want it to be like this:

Page 1-Scene 59
25.05.2011

Good afternoon sir,how are you today?
I'm fine,how are you?
Thanks for asking,I'm great

Just made up the content :) How can i modify a text file like this way?


Solution

  • You can't really modify it that way - file systems don't generally let you insert data in arbitrary locations - but you can: