Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Length of text file

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
I have to read a large (10,000 to 40,000 rows) CSV file into a stringGrid (I am using a component that will do the grouping).

I would like to show a progress bar or gauge to show the process of loading. Does anyone know how I can get the total number of rows in the file so I can write a new LoadFromFile procedure?

Thanks,
Rewdee
 
I've never found a way other than to run through the file and count them, then reset it to the top. Since a text file doesn't have fixed length lines, you basically have to read to all of the CR/LF's before you can know how many lines are in the file.
TealWren
 
Hi Rewdee
It might be posible to use the 'filesize' function to get the file lenght and use this to set the limits for your gauge, I don't know how sucessful this would be.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top