-
Record Count of Flat Files
Is there an easy way to find the number of records in a flat file (VB6) instead of opening it and keepin a counter as we read records? Any help will be appreciated.
Thanks
Siva
Siva
-
If the records are fixed-length, you may divide the file length (LOF or FileLen functions) by the record length to determine the number of records. If the records are variable-length, you may read the file in chunks of, say, 64K bytes and use InStr to count the number of end-of-record markers (e.g., vbCr).
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
It depends on how these records are stored, one per line, then just do a line count.
I've been programming with VB for 15 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Martin2k
Similar Threads
-
By barbarosa80503 in forum VB Classic
Replies: 2
Last Post: 10-28-2005, 03:33 PM
-
By terryb in forum VB Classic
Replies: 0
Last Post: 07-06-2005, 03:21 PM
-
By Sanjay in forum ASP.NET
Replies: 7
Last Post: 09-14-2001, 11:31 AM
-
By Andrew McLellan in forum Java
Replies: 3
Last Post: 05-09-2001, 05:34 PM
-
By Naveen in forum VB Classic
Replies: 1
Last Post: 05-23-2000, 07:36 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks