This program is a sales application that saves sales information to a .txt textfile, I want to know how to find the highest sales figure from the text file
method to write to file
method to write to file
try{
FileWriter fw = new FileWriter(salesfile,true);
BufferedWriter bw = new BufferedWriter(fw);
fw.write(" Product: "+itemname+"\t");
fw.write("\t\t");
fw.write("ItemCode: "+itemcode+"\t");
fw.write("\t\t");
fw.write("Unitcost: " +sunitcost+"\t");
fw.write("\t\t\t");
fw.write("Quantity: " +squantity+"\t");
fw.write("\t\t");
fw.write("Date of Purchase:" +dateNow);
fw.write("\n");
fw.write("\n");
bw.close();
fw.close();
}catch(IOException ioe){
System.out.println(ioe);
}