We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

getting # of lines in file

91mustang
91mustang asked
on
Medium Priority
359 Views
Last Modified: 2010-03-31
hello, how can i get the number of lines in a text file without looping though the lines?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
You can't really. Why would you want to though?

Author

Commented:
I have an app that reads a file in line parses line, inserts to DB,next line....

I want to use a Jprogress bar and use the number of lines in file as the maximum value for proggress bar
CERTIFIED EXPERT
Top Expert 2016
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
You'll need to do a pre-parse/dbInsertion parse to compare every character for '/n' and sum them.

Author

Commented:
thanks CEHJ
CERTIFIED EXPERT
Top Expert 2016

Commented:
8-)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.