• Post Reply Bookmark Topic Watch Topic
  • New Topic

writing to a file at a particular place

 
shield kumar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any way in java to write some textual data in a text file at a particular position..say i want to write a string "xyz" at 10th line and 15th column
 
Campbell Ritchie
Marshal
Posts: 52513
118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably not.
You would have to create a StringBuilder[] (or maybe better a List<StringBuilder>) with the contents of the file in, then insert at the appropriate location.
Remember array and String insertion indices have 0 = 1st position.
 
shield kumar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright campbell
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!