Re: Data table text I/O package?



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
.



Relevant Pages

  • Format when "0" is the first letter
    ... I have a Excel document that has many cells with "0" as the first character ... of a string of numbers. ... When I change the format to number, ...
    (microsoft.public.excel.misc)
  • Re: Date format detection
    ... Specifies the locale for which the date string is to be formatted. ... date format for this locale. ... the system default-date format for the specified locale. ... be enclosed within single quotation marks in the date format picture. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Date format detection
    ... > Specifies the locale for which the date string is to be formatted. ... > date format for this locale. ... > the system default-date format for the specified locale. ... > be enclosed within single quotation marks in the date format picture. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Date confusion
    ... Read my reply elsewhere in this string. ... > integer portion of the value represents the date as the number of days ... >> If you are working with a numeric date and you want the format DDMMYYYY, ... Another reason for preferring to store a date as text would be personal preference. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Regular Expression - old regex module vs. re module
    ... If you want to include backslashes in a string, ... a one character string, which is unlikely to be what you wanted. ... formating characters before a format, then you should use a negative ... #read in and parse a format template ...
    (comp.lang.python)