Re: VFP9SP1 How to determine # of rows using LLFF operations

Author: Mike Copeland

Posted: 2011-08-09 at 15:02:03

MB Software Solutions, LLC wrote on 2011-08-09:

>> How do I determine the # of rows in a fixed-width flat file? I want to

>> provide a progress update in the loop so I know how much % of the file

>> has been processed. I'm trying to avoid reading the entire file in with

>> ALINES. (But I guess maybe I could do that but it seems like too much

>> overhead.)

>>

>> Thanks!

>> --Mike

> Mike,

>

> It would be a two pass thing, or a best guess. I would go with the best

> guess.

> A tight loop getting the data and dumping it as you get a total count, then

> return to the top and begin processing.

> If you did this, since you have multiple types of data in the file, you

> could get a count of each type. Then show the progress of each type as you

> do the real processing.

>

> The best guess, FSEEK() to the end returns the total number of bytes. You

> can use this and add the bytes of each line to show the complete progress.

>

>

> Tracy Pearson

> PowerChurch Software

Just test for FEOF() with each iteration. I've never had a problem doing

that to "find the end."

Mike Copeland

Genesis Group

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4E41842B.6020002@ggisoft.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2011 Mike Copeland