Count lines of a particular file

Advertisement

In this section, you will learn how to count the availability of text lines in the particular file. A file is read before counting lines of a particular file, . File is a collection of stored information that are arranged in string, rows, columns and li

In this program you will learn how to read a file and count number of lines
in it. This is the simple program that opens a file and read one line at a time
and count no of lines in a file.

Program first asks the user to enter the extension of the file and then it
reads all the files with the input extension. Its reads the file(s) and then
prints the no of lines in each file.

Java provides many API's for reading, writing, updating and deleting the
file. You can also update the file content using Java programs.

Sami
May 26, 2011
question
I have a project about Text details file ( String Type )
I want to learn the method and how use it Of count lines
& size
>>> Thanks

vijay
October 8, 2011
c programming
1)I need a program to count the number of lines in a file
2)program to count the number of words in a line

raja
January 4, 2012
count number of lines in a file
count the statements which are:
--->logical statements
--->loops and end conditions
--->initializations,declarations,directives,import statements
Blank lines ,comment lines,or automatically generated code are not included in the count

santosha epili
May 2, 2012
code not visible
in this section the program code in not visible. plz update this page

Alex
August 11, 2012
how to write html code in java
How to write html code to a specific line in a file using java. Without altering content of the file.
Example:
line 1: has something
line 2 : //content to be written here.
line 3: has something
Hope i can get some useful answers. Thanks