parsing key file
Jose Lerebours
fpgroups at gmail.com
Wed May 26 06:11:05 PDT 2021
On 5/26/21 7:55 AM, Fairlight via Filepro-list wrote:
> No, no you didn't.
>
> You're overlooking the fact that ***you do not want to read the entire
> file into RAM at once***. That's a fast way to exhaust up to 2GB on
> 32-bit systems, more on 64-bit systems. Consider your system resources.
>
> There's a reason it was never done that way in the first place.
This is true if fopen() reads the entire file but we know it does not.
Beyond that, you are jumping from block to block and as you do so,
check data if applicable for processing or not.
Script can be enhanced by using strpos() to jump directly to the
block(s) where string is
found and not have to jump through the entire key one record block at a
time.
I extracted a few hundred records faster than a blink of an eye ...
created an HTML table
and exported to MySQL and printed the SQL statements as well.
Brian made reference to a PHP-filePro extension or class available, I
found info here
https://ftp.psu.ac.th/pub/php/html/ref.filepro.html
It is a read only class, but you can easily find that everything that
class does, is done within
the short script I posted yesterday.
Honestly, a simple script like that could be used for so many things:
a) key to JSON
b) key to HTML
c) key to PDF
d) key to XML
e) key to CSV
f) key to anything you wish, including SQL, MySQL, PostGress, or any DB
with ODBC one can access
from PHP script.
g) key to key removing all blank records or any block of records and
creating a neatly trimed down key
Brian provided this link
https://drive.google.com/drive/folders/18-LGU69TZsvRiIoO3UcJQRI9hTg3XB2F
where one can learn more about the various filePro documents layout.
I could be mistaken but it may work ...
--
https://www.asisuites.com
https://www.helpsuites.com
More information about the Filepro-list
mailing list