Re: Data table text I/O package?
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Jun 2005 14:27:34 +0200
On Thu, 16 Jun 2005 16:01:57 +0200, Georg Bauhaus wrote:
> Marius Amado Alves wrote:
>
>> For tables of atomic data tab separated is better.
>
> Note the crucial bits in this general statement.
>
> 1) You had really better have *atomic* data.
>
> 2) You had better have the format as your own format and
> no data exchange with any system requiring "just
> your table files, please".
>
> Tab separated atomic data can be "semi-structured"
> too. Consider 04/06/05 and tell me wich calender date that
> is, in [choose country here].
>
> It makes litte sense to say XML = semi, TAB = atomic without
> specifying what exactly you mean by semi-structure data.
> Consider
>
> <Date y="2005" m="June" d="04"/>
>
> If a program maintains a table of calender dates
> for internal use, then 2005-06-04, or 2005 TAB 06 TAB 04
> save space and is easy to use. But it also restricts
> the table to an internal data format.
Not necessarily.
There is a better technique to parse strings than to tokenize them first.
Get rid of scanner. Just take the date from the current position of the
string and advance the position to the first character following the date.
Because the procedure that gets the date knows the format it also knows
where the date ends. It can also support various concurrent formats,
provided that they are distinguishable. This way you can parse a string
virtually knowing nothing about the formats of its fields. An additional
advantage is that error messages (if it comes to a more advanced system)
will be pretty easy to generate.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- Follow-Ups:
- Re: Data table text I/O package?
- From: Georg Bauhaus
- 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
- Re: Data table text I/O package?
- From: Marius Amado Alves
- Re: Data table text I/O package?
- From: Georg Bauhaus
- Data table text I/O package?
- Prev by Date: Re: Data table text I/O package?
- Next by Date: Re: Universal type in Ada
- Previous by thread: Re: Data table text I/O package?
- Next by thread: Re: Data table text I/O package?
- Index(es):
Relevant Pages
|