wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Java Code to Edit Output File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Code to Edit Output File" Watch "Java Code to Edit Output File" New topic
Author

Java Code to Edit Output File

Omo Jesu
Greenhorn

Joined: Nov 30, 2010
Posts: 19
Hello,

I have a working program that normally, I hand-wire the information into the file and it is stored in an array and I work with it till the end of the program. This is where the problem is coming from.

Now the document will be in an external file, and the informations needed for the program should be read from the external file;

At the beginning of the program, the input file will be loaded into the program and the file will be saved at the end of the program. Giving room for editing / adding to the file during program run and at the end save all the information back into same external file.

Please how am I to go about this? I really need help in here....

Thanks for your help in advance.

Regards
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

What do you mean with an external file?

If it is just a file on your file-system then this should work:

Read the file into memory
Do some editing
Write to the file.

If you don't know how to read/write from/to a file see the oracle tutorial.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Omo Jesu
Greenhorn

Joined: Nov 30, 2010
Posts: 19
Wouter Oet wrote:What do you mean with an external file?

If it is just a file on your file-system then this should work:

Read the file into memory
Do some editing
Write to the file.

If you don't know how to read/write from/to a file see the oracle tutorial.


Thanks Wouter for the response... but I am confused about writing arrays and reading arrays from a local file (I mean file stored on the local system) because it consists of something like this;

Names [Omo Jesu]
No of Subjects [3]
The Subjects[15, 52, 55]
Final Mark[32]


Something like that and they are all of different data types and also the subjects also also changes... like some might be of length 5 and some of length 6 and might also need to work on the length if i need to calculate the average.

Rgds
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Code to Edit Output File
 
Similar Threads
Setting the classpath
Installing the Android SDK
Help with program structure
please ..i need help!
Implementing MultiDimensional Vectors