parsing key file
Fairlight
fairlite at fairlite.com
Wed May 26 14:23:38 PDT 2021
The part where you said create an array in memory and store the data
there for later operations implied to me that you would just read the
records in wholesale and operate on them quickly...which is the only way
to do it, since you don't have index access.
Also, you wouldn't use an array. You should use a hash/dict. Arrays
are going to be far slower to use.
m->
On Wed, May 26, 2021 at 09:11:05AM -0400, Jose Lerebours via Filepro-list thus spoke:
> 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
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
--
Audio panton, cogito singularis.
More information about the Filepro-list
mailing list