built-in file insertion routine?

K

Ken Kafieh

I am getting better at navigating the Java documentation.
I was looking to see if there was a built in routine for inserting text into
the middle of a file.
I have about given up looking. So before I start to implement an insertion
routine from scratch, can someone give me a hint if maybe I missed something
and should keep looking?


-Ken
 
C

Chris Smith

Ken said:
I am getting better at navigating the Java documentation.
I was looking to see if there was a built in routine for inserting text into
the middle of a file.
I have about given up looking. So before I start to implement an insertion
routine from scratch, can someone give me a hint if maybe I missed something
and should keep looking?

No, no such thing exists.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
R

Roedy Green

I am getting better at navigating the Java documentation.
I was looking to see if there was a built in routine for inserting text into
the middle of a file.

It has to be done either by writing a new file up to the insert point,
writing the insertion, then writing the rest. Alternatively, you read
all the pieces into ram and do the same thing, of possibly do the
combing in RAM and write the thing out as in one i/o.


You then delete the old file and rename the new file to it.

See http://mindprod.com/jgloss/fileio.html for how to create the i/o.
See http://mindprod.com/jgloss/temporaryfile.html for how to create a
file in the same directory that can be easily renamed the original.

If need such a beast in a hurry, I could write it for you for $50 US.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top