Re: Data table text I/O package?
- From: Marius Amado Alves <amado.alves@xxxxxxxxxx>
- Date: Thu, 16 Jun 2005 11:53:52 +0100
On 16 Jun 2005, at 10:55, Jacob Sparre Andersen wrote:
Randy Brukardt wrote:
I may be dense, but isn't this the purpose of XML? If so, why reinvent the wheel?
d) I'm _not_ going to switch away from tabulator separated tables for purposes, where tabulator separated tables are a sensible representation of the data in textual form.
Indeed. XML is for semi-structured data and/or text data with Unicode etc. For tables of atomic data tab separated is better. More readable, efficient, sensible, not requiring a monster XML library.
It is the matter of automagically generating code for reading and writing that file format.
Yes. This is interesting, useful, and easy. From the header you get the field names, from the first data line with deduce the data types. With these elements you can generate the record type and procedures to read the file. A trick I often use to deduce data types is based on 'Value:
function Get_Type (Value : String) return Data_Type is
F : Float;
I : Integer;
begin
F := Float'Value (Value);
return Type_Float;
exception
when Constraint_Error =>
begin
I := Integer'Value (Value);
return Type_Integer;
exception
when Constraint_Error =>
return Type_String;
end;
end;.
- Follow-Ups:
- Re: Data table text I/O package?
- From: Georg Bauhaus
- Re: Data table text I/O package?
- From: Robert A Duff
- Re: Data table text I/O package?
- References:
- Data table text I/O package?
- From: Jacob Sparre Andersen
- Re: Data table text I/O package?
- From: Preben Randhol
- Re: Data table text I/O package?
- From: Jacob Sparre Andersen
- Re: Data table text I/O package?
- From: Preben Randhol
- Re: Data table text I/O package?
- From: Jacob Sparre Andersen
- Re: Data table text I/O package?
- From: Randy Brukardt
- Re: Data table text I/O package?
- From: Jacob Sparre Andersen
- Data table text I/O package?
- Prev by Date: Re: Data table text I/O package?
- Next by Date: Re: MinGW and AdaGIDE
- Previous by thread: Re: Data table text I/O package?
- Next by thread: Re: Data table text I/O package?
- Index(es):