What will be the format of the integers in your text file? For example: ints separated by spaces, commas, lineshifts? Ints as text, ints and text?
What manipulations do you wish to accomplish?
Joined: May 02, 2004
o.k..here is the example i'm trying from the bruce eckel book: date time tempreture 09032004 22.43 298.30
have to be manuplated to be: Line 1:The date on which the Summary file is generated in the format dd/mm/yyyy. Line 2:The time at which the Summary file is generated in the format hh:mm and using a 24 hour clock format for the hours. Line 3:The date and time of the first data reading in the data file using the same format as that given immediately above. Line 4:The date and time of the last data reading in the data file using the same format as that given immediately above. Line 5:The number of valid data readings found in the data file � including the first and last readings if they are valid. Line 6:The number of invalid data readings found in the data file � including the first and last readings if they are invalid. Line 7:The minimum valid temperature value found in the data file. Line 8:The maximum valid temperature value found in the data file. Line 9:The average of all the valid temperature values found in the data file.
i know pretty much how started by identifying the input and output files,creating text files, setup a tokenizer and place a try and catch statement, but i really don't how to put it all together..anyone can help..this not h/w but i have been given an assignment like that in which i need to practice and do examples like those to work it out.
Second, the best way to write a big program is to write a small one and add to it a little at a time, testing as you go. You've written a whole lot of code here which can't compile. You ought to start by getting just an empty class declaration to compile, and then an empty class including a main() to compile, and then have main print "hello, world" and run the program and make sure it works. Then try opening a file, reading a line, and printing it to System.out. Then you could open a second file for writing and putting the line into that file. Take small steps, and test each step along the way.
Third, write small methods. Don't write this whole program in main.
Tim and Ernest, i have followed your lead and tried to write the program step by step, how ever when i wrote the read part sepertly and then the print write seperatly i can't seem to connect the two and don't know where the manipulation part of the text should be at..here it is so far: