Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
I/O and Streams
counting number of lines of system.out
Joey Brown
Greenhorn
Posts: 12
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How would i count the number of lines of system.out and loop it so it's continually updating. Anyone know?
Joey Brown
Greenhorn
Posts: 12
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I guess I need to do a count on the io stream and declare it as an int. I just don't know how to do this.
Antonio Costa
Greenhorn
Posts: 11
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Joey,
have a look to my posts. I'm programming a file splitter and I had the same questions. Could you post some code?
Antonio
// getting the total number lines within the file private int getTotalNumberOfLines() { try { totalNumberOfLines = 0; File file = new File(sourceFilePath); if (file.exists()) { fr = new FileReader(file); lnr = new LineNumberReader(fr); while (lnr.readLine() != null) { totalNumberOfLines++; } lnr.close(); } } catch (IOException ex) { Logger.getLogger(PofDataStreamSplitter.class.getName()).log(Level.SEVERE, null, ex); } return totalNumberOfLines; }
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Metrics
Swing-JTextArea
html:errors renders none of my errors
How Groovy Helps Java Developers
StringTokenizer and End of file question
More...