Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Code to Edit Output File

 
Omo Jesu
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Omo Jesu
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic