Re: Data table text I/O package?



Preben Randhol wrote:
> Jacob Sparre Andersen <sparre@xxxxxx> wrote on 15/06/2005 (13:38) :

> > The important part is to have the checking of the headers and the
> > generation of Put_Line and Get_Line procedures automated based on
> > a record type (and not too much more). Since I need records (for
> > type checking) and not just simple arrays, I can't manage with a
> > generic package, but have to put some code generation into the
> > system (or can I play some tricks with streams?).
>
> So the header might be:
>
> Integer Float Text

Not quite. The headers would be field names, not just types. I.e.:

Gene ID p-value Expression-level Description Human cromosome
GE29031 0.04539 245.45 Cyclin-B1 17

> and the data could be:
>
> 1 0.9 Start point
> 2 0.3 Minimum
> 3 6.0 End point
>
> and then you want to check the data and validate that they are of
> the correct type as indicated by the header? To generate the header
> you want that the package finds out which type a certain data type
> is and output this type in the header?

Sort of. Except that I would use the names of the fields in the
record and not just the types of the fields.

One of my problems is that I have different kinds of files (in terms
of meaning of the numbers) where the types for all practical purposes
are the same.

But it seems like it might be more efficient to code a library like
that by hand for each case, even though it means that I miss the
automated checking (my main reason for using Ada).

Jacob (who should remember not to want the impossible every day)
--
»If you're going to have crime,
it might as well be organized crime.« -- Lord Vetinari

.



Relevant Pages

  • Re: Associate argument with entry in header file
    ... > We want to associate a argument with a corresponding entry in header ... > The argument is defined in a header file. ... insert a CodeWorker script into your mainfunction. ... CodeWorker is a parsing tool and a source code generation, ...
    (comp.lang.c)
  • Re: Basic ASCII File Reading
    ... critical first step to almost anything like this - defining the problem. ... FJ appears to have guessed that the header is always exactly 7 lines. ... His involves allocating and deallocating, ... time consuming than resizing arrays. ...
    (comp.lang.fortran)
  • Re: Basic ASCII File Reading
    ... FJ appears to have guessed that the header is always exactly 7 lines. ... time consuming than resizing arrays. ... which avoids an allocate statement and a vector copy. ... The rewind would reset pointers if the data ...
    (comp.lang.fortran)
  • Re: reading data files with headers and columns
    ... As a noob to Ruby, I need to read a data file with the first few lines ... as header, then the rest of the file as columns of different variables ... as arrays ... Could someone help with a few lines of basic code? ...
    (comp.lang.ruby)
  • Re: reading data files with headers and columns
    ... If you know how many header lines, I'll assume 3, just read them first ... # open file in read mode ... # extract your variables in the line into an array ... as arrays ...
    (comp.lang.ruby)