comp.lang.ada
 help / color / mirror / Atom feed
From: "Tom Hargraves" <tharg@vtcinet.com>
Subject: Re: Tokenizing a string in Ada
Date: 2000/11/03
Date: 2000-11-03T00:00:00+00:00	[thread overview]
Message-ID: <3a030814@rsl2.rslnet.net> (raw)
In-Reply-To: 8tuk98$c7k$1@nnrp1.deja.com

Hi Ted,

This post is more akin to Franck's post 'binary tree and files', but since
you are promoting 'open token' I thought I'd post this here. [NB. I have not
had time to study Open Token, so maybe my answers are there]

Many many many times I have seen Ada (and other) programmers saving data
structures in files, the more astute save them in human readable form,
unless there is a pressing performance hit.

I have seen just as many different ways to save this data, from a variety of
tags, indenture, tuples etc. Is there not some standard way of doing this?
If there isn't should there be?

Is XML a standard we should choose? Seems to provide nesting, a flexible tag
schema, and freely available format checkers.

Are there any easy to use ada packages available to facilitate this?

Yours curiously,
Tom H.


"Ted Dennison" <dennison@telepath.com> wrote in message
news:8tuk98$c7k$1@nnrp1.deja.com...
> In article <20001103063537.25697.00000237@ng-mf1.news.cs.com>,
>   rbbaldwin8@cs.com (Rbbaldwin8) wrote:
>
> > I need to read lines from a text file which consist of a mixture of
> > strings and numeric values separated by commas and use these values in
> > the application. The format of each line is the same as far as which
> > data is in each position. I think the safest way to do this is to read
> > each line into a fixed-length string, then split it at the commas.
> > Strings in the CSV lines are not quoted but do not contain  commas
> > within the strings.
> > How can I do this in Ada.  I can't find a string function like C's
> > strtok or TCL's split, or am I misssing something.
>
> Check out the Ada.Strings.* packages. In particular, look at
> Ada.Strings.Fixed.Index and Ada.Strings.Fixed.Find_Token. While you are
> at it read entirely through LRM annexes A, L, and K. If you don't have
> an LRM, you can borrow ours at
> http://www.ada-auth.org/~acats/arm-html/RM-TOC.html :-). There's lots of
> goodies in there that every Ada programmer need to know about.
>
> If you are going to have to do this kind of thing a lot, you may want to
> look into OpenToken (
> http://www.telepath.com/dennison/Ted/OpenToken/OpenToken.html ). I use
> it to tokenize at least 3 different kinds of .csv files, along with a
> couple other configuration files on the project I'm working on now. It
> alreay has a predefined token type for CSV "strings" (as you call them).
>
>
> --
> T.E.D.
>
> http://www.telepath.com/~dennison/Ted/TED.html
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.






  reply	other threads:[~2000-11-03  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-03 11:35 Tokenizing a string in Ada Rbbaldwin8
2000-11-03 13:55 ` Florian Weimer
2000-11-03 15:06 ` Ted Dennison
2000-11-03  0:00   ` Tom Hargraves [this message]
2000-11-03  0:00     ` Ted Dennison
2000-11-03  0:00     ` Larry Kilgallen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox