[REBOL] parse with skip Re:(2)
From: petr:krenzelok:trz:cz at: 21-Aug-2000 14:06
[Petr--Krenzelok--trz--cz] wrote:
> [moeller_thorsten--gmx--de] wrote:
>
> > Hi List,
> >
> > I have a file containing the following kind of lines:
> >
> > 9;"1081230012";9999999;1000103;0;84.00;0;9999999;0.84;1;"6";0;991030;0;73.92
> > ;0.84;9;"L";991030;0;108;123;0;" "
> >
> > With this line i like to get rid of the leading "1" ( should be yymmdd
> > 00/01/03 )in the 4th field. For this i like to use the following code:
> >
> > val: 1000000
> >
> > parse line [skip ";" 2 thru ";" copy text to ";" (if greater? to-integer
> > text val [remove/part text 1])]
> >
> > For most lines in the file this works fine, but if the number before the
> > first semikolon changes to over 9 ( e.g. 21 ) this won't work anymore.
> >
> > Does anyone know why?
> >
>
> somenum: charset "0123456789"
>
> parse line [skip somenum ";" ....
nah, what an nonsense, sorry ... should be:
num: charset "0123456789"
parse line [some num ";" etc ....]
... and even now ... better don't trust my code :-)
-pekr-