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 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
Ads
Related Tutorials/Questions & Answers:
Advertisements
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
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
how can i display a pdf file in a jtextarea
how can
i display a pdf
file in a jtextarea
I need to
display a pdf
file in a jtextfield or in a jtextarea.Atlest
i need to displat it in a jframe.I have a button and while clicking on it ,
i need to choose the pdf
file and
need
I have doubt in jsp file.
I have doubt in
jsp file.
I have doubt in
jsp file.
In a
jsp file, there should be two buttons.
One is start and other is stop.
When we click on start then only stop should be enabled. Other wise it should be disabled.
When
i need the source code to generate id in jsp
i need the source code to generate id in jsp hai,
i need the source code for generate id...
which is
i need to generate the new id from the maximum+1,like automatically when
i click the button...as well
i have several kinds
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
Do I need math for data science?
Do
I need math for
data science? Hi,
I am beginner in
Data Science and machine learning field.
I am searching for
the tutorials to learn:
Do
I... so that
I can learn the
topic "Do
I need math for
data science?"
What skills do I need to be a data analyst?
What skills do
I need to be a
data analyst? Hi,
I am beginner in
Data Science and machine learning field.
I am searching for
the tutorials to learn:
What skills do
I need to be a
data analyst?
Try to provide me good
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
Jsp error when i run this a jsp file
Jsp error when
i run this a
jsp file hi
I got this error when
i run the
jsp file in IDE and outside also
please help me
java.lang.NullPointerException
org.apache.jsp.insertjsp.jspInit(insert_jsp.java:22
Which extension i use for save hibernate file.
Which extension
i use for save hibernate
file. Please give me answer that
which extension
i use for save the hibernate
file and how
i run that
file as well as complie that
file.
hi friend,
Naming convention
I need an example of sessionfactory
I need an example of sessionfactory Hi,
I need an example of session factory in hibernate. If you can provide me
one with, that would be great...Thanks
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
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
i need project
i need project can u send online shoppin project 2 my mailid.
Please visit the following links:
Struts2 Shopping cart
JSP-Servlet Shopping cart