• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Java Code to Edit Output File

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Always! Wait. Never. Shut up. Look at this tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic