"One of the great things about FoxPro," a wise man (or was it a wise guy?) said, a couple of decades ago, "is that there's three ways to do anything in FoxPro. Or no way at all."
This thread is a great illustration of this. Every three days, someone else drifts through the forum and suggests MEMLINES(), MLINE(), ALINES(), LLFFs, FileToStr(), the OS's FileSystemObject, APPEND, APPEND TO MEMO, file size limits (16Mb or 2Gb, depending on which), shelling out to PowerShell (1), using the Linux wc (wordcount) ported to Windows or using the new Linux under Windows, using Office Automation to import the file to Excel (or Word!) and querying the number of lines, or some other solution.
There's some elegant solutions in Perl or Python, too, if you happen to have them installed.
(1) https://blogs.technet.microsoft.com/heyscriptingguy/2011/10/09/use-a-powersh...
On Fri, Apr 28, 2017 at 6:22 AM, Laurie Alvey trukker41@gmail.com wrote:
Have you thought about the ALINES() function?
Laurie
On 27 April 2017 at 16:12, Fernando D. Bozzo fdbozzo@gmail.com wrote:
Hi Mike:
A very fast method is using the FileSystemObject:
loFSO = CREATEOBJECT("Scripting.FileSystemObject") loFile1 = loFSO.OpenTextFile(lcArchivo1, 1)
Look at the syntax on Microsoft web site for the read method. It does not have the limitation of VFP's fread/fgets
Regards
El 21/4/2017 4:45 p. m., mbsoftwaresolutions@mbsoftwaresolutions.com escribió:
VF9SP2
Currently, I'm simply doing this for now:
RowCount = OCCURS(CHR(13),FILETOSTR(m.Filename))
Is there a better (read: FASTER) way? These are tab delimited text files so I can't really use FSEEK or FSIZE(m.Filename) (which requires SET COMPATIBLE ON) because I can't be sure of each record's length.
tia, --Mike
[excessive quoting removed by server]