[erlang-questions] Re: string to tupple ?

info info@REDACTED
Mon Jun 21 16:41:52 CEST 2010


> The obvious question is "WHY"?

Presumably you meant "why isn't that data structured relationally"
instead of "why extract data from a database" :) One possible answer
is that it's someone else's database.

Exactly ! I must use these data "as is". 

> For example, if you know the numbers are whole numbers,
> the very simplest code would be
>         [X || {integer,_,X}  <- erl_scan:string(String)]
> which would give you a list of integers.

That'll throw a "bad generator" error. Did you mean this:

  {ok,Tokens,_} = erl_scan:string("(1,2),(3,4)"),
  [X || {integer,_,X}  <- Tokens].

?

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED


More information about the erlang-questions mailing list