aspose file tools*
The moose likes I/O and Streams and the fly likes writing data at a particular postion in a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "writing data at a particular postion in a file" Watch "writing data at a particular postion in a file" New topic
Author

writing data at a particular postion in a file

Sayali Basole
Greenhorn

Joined: Mar 15, 2013
Posts: 1


I want to write a data in a .java file at a particular position.. I have tried with randaomAccessfile but it is not working. please give some proper suggestion
Thanks in advance
James X Peterson
Whizlabs Java Support
Ranch Hand

Joined: Feb 26, 2013
Posts: 158
Hi Sayali Basole,

first read complete java file in to a string and then by using conditions get the position where you want to write the data. write the data at that position and write the modified string in to the file.


Regards,
James
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2420
    
  50
Welcome to the Ranch,

Please TellTheDetails (← click) just saying it doesn't work doesn't make it easy for anyone to help you. Please explain what you have tried, what you expected to happen, what actually happened and post a SSCCE .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing data at a particular postion in a file