Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Beginning Java
Number of lines in the text file
Mike Yu
Ranch Hand
Posts: 175
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
What is the easiest way to find the total number of lines in a text file?
I know we can create a LineNumberReader and count it line by line.
Thnaks,
Mike
Thanks,<br />Mike
Petrus Pelser
Ranch Hand
Posts: 132
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I don't think that the number of lines in a text file is stated explicitly (like for example the file's size). You would have to calculate it manually. Yes that means counting them one by one.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
text file ?? simple program
How to replace data in a file
read specific line from text file
using linereader
generate a text file with random no of characters
More...