Text Files or binaries with objects?



Hi.

I have some large text files that I need to repeatedly analyse. I can easily
parse the strings and load the data into my custom object ready to be
analysed, but the parsing has to take time, and I have a large number of
these text files to analyse.

Wouldn't it be more efficient, given that I will be re-analysing each text
file many times over many sessions, to parse the text files once, then save
my list of objects as a binary file, effectively avoiding the need to
repeatedly parse strings? I imagine it would, but I'm not sure how to do it.
At the moment I am using a TStringList to store the custom objects, but it
appears the SaveToFile method only saves the strings, not the objects
associated with them. If I use some SaveToStream cose, how do I decode the
stream when it come back?

The objects I use are really just records at the moment, with several
properties of type 'Single', and one 'TDateTime' property. I have used an
object type just in case I need to add methods etc that I haven't
anticipated.

thanks in advance for any hints or pointers.

Paul.


.



Relevant Pages

  • Re: Text Files or binaries with objects?
    ... I have some large text files that I need to repeatedly analyse. ... parse the strings and load the data into my custom object ready to be ... file many times over many sessions, to parse the text files once, then save ...
    (alt.comp.lang.borland-delphi)
  • Re: REXX 5 Message
    ... selected are determined by a Boolean expression relating the strings. ... IF, UNDER THE OREXX INTERPRETER, THIS CMD RUNS OUT OF RESOURCES ... parse value datetimewith. ... of drives to be searched */ ...
    (comp.lang.rexx)
  • Re: parsing problem
    ... find the most middle operand and the strings between it -> string1: ... I think that what you really want to get in the end here is a parse ... the only three kinds of nodes in the tree ... static Node ParseAOExpr(string input, ref int index) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is it possible to have special characters in list
    ... You *have* to parse that line by line! ... While I agree that one can't treat arbitrary strings as a list, ... way to sensibly handle that list, just because the plaintext-column ... targetted to the problem at hand (parsing that particular format), ...
    (comp.lang.tcl)
  • Re: Memory Image, Strings termination
    ... > I am writing a code to analyse a file. ... > file into a memory, then I parse through the content. ...
    (borland.public.delphi.language.objectpascal)