Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read from a file , do some arithmetic and output to a file

Status
Not open for further replies.

1234100

Programmer
Feb 20, 2007
2
US
Hello,
i am new to java and i have a simple question, whats the best function to read an input from a file and then perform some arithmetic calculations on this input , and then output the result to an other file,
joe
 
That's not a java-task - imho.

If the java program reads from System.in, and writes to System.out, a user may input the values by the keyboard, and gain feedback on the screen.

If he likes to use files for in- and/or output, he might do:
Code:
java Calculate < from.file > to.file

The input might be generated with another program, and the output formatted by a third one:

Code:
cat from.file | java Generator | java Calculator | java Formatter > toFile.html
Very flexibel.

don't visit my homepage:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top