Home Answers Viewqa Java-Beginners I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.

 
 


Minal Patil
I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.
0 Answer(s)      a year and 5 months ago
Posted in : Java Beginners

I am reading the file using BufferedReader, then writing the output like this:

String fileName = "C:\\M2011001582.TXT";
 BufferedReader is = new BufferedReader(new FileReader(fileName));
 int lineCount=1;
 String fileData = "";
 out.println("<table border=\"1\" ><thead>"
   + "<tr><th>  SNO </th>"
   + "<th>  Batch Number </th>"
   + "<th>  amount </th>"...</tr>);
 while((fileData = is.readLine()) != null)
 {
   out.println( "<tr>"
     + "<td>" + lineCount++ + "</td>"
     + "<td>" + fileData.substring(0,6) + "</td>" //batch no
     + "<td>" + fileData.substring(6,14) + "</td></tr>" ); //amount...
  }

The output displays 4 rows and 2 columns. How can I calculate the total amount?

View Answers









Related Pages:
I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.
I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.  I am reading...... } The output displays 4 rows and 2 columns. How can I calculate the total
i want to display where i entered values to same page
i want to display where i entered values to same page  hi friends !! i have a values from jsp page .and i want to store that values into DB at the same time i want to show immediatlly on same jsp page with tabular format
a jsp code for creating a text file
a jsp code for creating a text file  Hello,i need jsp code for creating a new text file for each user, when they login in to the website for creating a new data file. So i need a jsp code for following options. when user login
I am getting Undefined in Text Box Very Urgent - JSP-Servlet
I am getting Undefined in Text Box Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. Thanks for your superb reply. I got the coding. But I find... the value "Undefined" in Emp ID text box which is present in the main page.. Here's
How to read and display data from a .properties file from a jsp page
How to read and display data from a .properties file from a jsp page  I have a .properties file. I have to create a jsp page such that it reads the data from this .properties file and display it in table format. Ex:by using
Text File I/O - DVD.java - Java Beginners
Text File I/O - DVD.java  NEED HELP PLEASE. The application should use a text file with one value on each line of the file. Each movie would use... starts, read the data file and populate the array. When the file ends, use
i want to display where i entered values to same page
i want to display where i entered values to same page  hi friends !! i have a values from jsp page .and i want to store that values into DB at the same time i want to show immediatlly on same jsp page with tabular format
i want to display where i entered values to same page
i want to display where i entered values to same page  hi friends !! i have a values from jsp page .and i want to store that values into DB at the same time i want to show immediatlly on same jsp page with tabular format
i need help - Development process
()); } } } it is printing the result of ping in to a file,but if i want to maintain two files in which one file will be for the reply arrived and the other...i need help  hello, i need help regarding this program. public
Creating a File I/O using import scanner, io.* and text.*
Creating a File I/O using import scanner, io.* and text.*  open a file for reading and open another file for writing data. input file hours-int, hourly rate-double, name-string. output file name-string, hours-int, hourly rate
i/o
for the test You can come out with your own test data. b. Read the data from the file and calculate the average for each question and for total marks. Determine...i/o   Write a Java program to do the following: a. Write into file
I need help in doing this. - Java Beginners
I need help in doing this.  Student DataBase i will need creating... and their methods as needed. What program should do (Tasks): i) Read data in from... + "/" + year); } } Since these are parallel arrays, the data for student[i
I/O Program output error
file, but I am getting incorrect output. I have been successfull with part of the program in that it reads the text file and analyzes it, however I need it to take... the total. I also need the pValues to be in decimal format like(#.##), but I can't
File I/O
File I/O  i am trying to read and write a 54mb text file from one directory to another. I managed to do it perfectly using the examples i was given... question is, is their away i can read and write in the shortes time possible(in seconds
Hi ..I am Sakthi.. - Java Beginners
Hi ..I am Sakthi..  can u tell me Some of the packages n Sub... JSP Struts2.0 HTML "); tabbedPane.addTab("Four", icon, panel4, "Now click... Tutorial"); tabbedPane.addTab("One", icon, panel1, "Does nothing
File I/O
File I/O  greetings i was running into a problem. is their a way to read multiple files from one and write the in a different directory one by one...(); File[] files = file.listFiles(filter); for (int i = 0; i <
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?  import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class ReadFileExample
File I/O
File I/O  i am trying to write a program that reads a text file... the text file then read it and write it into as a comma delimitade file. i have... with "tAC" and ends with "->0|0|6" as you shall see in the text file i have
This is what i need - Java Beginners
. for this question i need just : one function can read string like (I like...This is what i need  Implement a standalone procedure to read in a file containing words and white space and produce a compressed version of the file
File I/O
File I/O  i have a problem i am trying to print on a new line every time i reach a certain condition "if(line.startsWith("Creating"))" i want... = file.listFiles();//listFiles all file in inpath dir for (int i = 0; i <
need help pleaseee....i weak in java
need help pleaseee....i weak in java  QUESTION 1 You are required... users and calculate the charges based on data entered by the user. Data needed... any one of the two selection structures. c) Calculate the charges based
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
into database in multiple rows..means one value for one row  Hai, I need... file.it was stored in perticular directory now i have to read the stored(.csv... table in multiple rows(which means one value for one row). eg: my file containes
I want this jsp answers
jsp page, server can develop a .java file for a particular jsp page or not? What... develop under web application? Is it Possible to include text file to jsp pages...I want this jsp answers    How can we declare third party classes
I want this jsp answers
jsp page, server can develop a .java file for a particular jsp page or not? What... develop under web application? Is it Possible to include text file to jsp pages...I want this jsp answers    How can we declare third party classes
I need your help - Java Beginners
I need your help  For this one I need to create delivery class for a delivery service .however, this class should contain (delivery number which... object field, display every Delivery object field) The file name
how can i hide and show tables
how can i hide and show tables  hai, i am creating a form which... i want to display the tables with result.so any help is appreciated much <... which is having a table consists of database data and a Go button. Using
Need to develop a control panel for application form which is developed in jsp
in jsp  I have created one application page which contains some check boxes,radio buttons and text boxes in jsp this for user to fill it. Now I need... to display and hide some check boxes,radio buttons and text boxes. I am not getting any
i can not connect to database in servlet - JSP-Servlet
i can not connect to database in servlet  Hi I am following...:8080/DataInsertion/DataInsertion) in the browser, i got no response and the page stayed blank with Done response at the bottem of the page(status bar). By the way ,I have
i can not connect to database in servlet - JSP-Servlet
i can not connect to database in servlet  Hi I am following...:8080/DataInsertion/DataInsertion) in the browser, i got no response and the page stayed blank with Done response at the bottem of the page(status bar). By the way ,I have
Java I/O Data Streams
Java I/O Data Streams In this tutorial we will discuss the Java I/O Data Streams. To deal with the binary I/O of primitive data type values as well... or the DataOutput is the interface which is implemented by all the data streams classes
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to open the pdf file when i execute the jsp page...{ document.close();} %> </body> I added itextpdf jar file
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to open the pdf file when i execute the jsp page...{ document.close();} %> </body> I added itextpdf jar file
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to open the pdf file when i execute the jsp page...{ document.close();} %> </body> I added itextpdf jar file
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to open the pdf file when i execute the jsp page...{ document.close();} %> </body> I added itextpdf jar file
How to read the contents in a file which is of input type file
How to read the contents in a file which is of input type file  I have a jsp page wherein i have to passs the file as input and read the contentsn... //In this servlet page i have tried to read the contents of a file in doPost method. I have used
converting one file format to another
converting one file format to another  Hi ser I need a code to export data from data grid to PDF and XL format plz help me out
hello there i need help
hello there i need help  : i need to do a program like... i am a beginner, and aside from that i am really eager to learn java please help me with the codes and please explain to me how it works. i only need to use
I have need to help
I have need to help  Write a program that, for four points A, B, C and P, draws a triangle formed by ABC and a small cross showing the position of P; and displays a line of text indicating which of the following three cases
Java I/O Assistance + Loop
)); //Because I only add a new line at the end, I only need to read the first line... and append all odd numbers 1-100 and finally close file. But for some reason I... peers to no luck. I now come here in hopes of assistance. the problem is within
Produces XML file but format not correct for storing data using JSP and XML
Produces XML file but format not correct for storing data using JSP and XML  hii I have created a project using JSP and XML as database to store data... XML file also(wrong format),shows result in JSP page but server shows
how to validate javascriptcode n i am attaching file give validations
how to validate javascriptcode n i am attaching file give validations  <%@page import="java.sql.SQLException"%> <%@page import="com.rajsoft.CAF.util.DBconnection"%> <%@page import="java.sql.Statement"%> <
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp  read data from excel file and update database using jsp Hi, I am using a MySQL database... format and I need to update MySQL tables with new experimental data. How can I
how to validate javascriptcode n i am attaching file give validations
how to validate javascriptcode n i am attaching file give validations  <%@page import="java.sql.SQLException"%> <%@page import="com.rajsoft.CAF.util.DBconnection"%> <%@page import="java.sql.Statement"%> <
how to validate javascriptcode n i am attaching file give validations
how to validate javascriptcode n i am attaching file give validations  <%@page import="java.sql.SQLException"%> <%@page import="com.rajsoft.CAF.util.DBconnection"%> <%@page import="java.sql.Statement"%> <
how to validate javascriptcode n i am attaching file give validations
how to validate javascriptcode n i am attaching file give validations  <%@page import="java.sql.SQLException"%> <%@page import="com.rajsoft.CAF.util.DBconnection"%> <%@page import="java.sql.Statement"%> <
how to validate javascriptcode n i am attaching file give validations
how to validate javascriptcode n i am attaching file give validations  <%@page import="java.sql.SQLException"%> <%@page import="com.rajsoft.CAF.util.DBconnection"%> <%@page import="java.sql.Statement"%> <
how to validate javascriptcode n i am attaching file give validations
how to validate javascriptcode n i am attaching file give validations  <%@page import="java.sql.SQLException"%> <%@page import="com.rajsoft.CAF.util.DBconnection"%> <%@page import="java.sql.Statement"%> <
i am getting the problem when i am downloading the pdf file from oracle 10g database - Struts
i am getting the problem when i am downloading the pdf file from oracle 10g database  if i created the pdf file from pdf machine,it is storing into datbase and download the pdf file from database. but when i created the pdf file
File I/O - Text Files
Java NotesFile I/O - Text Files Java can read several types of information from files: binary, Java objects, text, zipped files, etc. One of the most common problems is reading lines of text. Example: Copy one file to another
read XML file and display it using java servlets
read XML file and display it using java servlets  sir, i can't access Xml which is present in my d drive plz can u should go through my code n tell...-fold> } jsp: <%@page contentType="text/html"%> <%@page pageEncoding