quotes gone
[1/4] from: chris::langreiter::com at: 31-Oct-2002 15:10
Is anyone else finding the quote-eating behaviour of parse(/all!)
rather annoying, too? Is there any known workaround?
>> parse/all "Carl ^"Chief REBOL^" Sassenrath" " "
== ["Carl" "Chief REBOL" "Sassenrath"]
Best regards,
-- Chris
[2/4] from: lmecir:mbox:vol:cz at: 31-Oct-2002 16:01
Hi Christian,
> Is there any known workaround?
The workaround is to use a block rule for parse.
-L
[3/4] from: greggirwin:mindspring at: 31-Oct-2002 10:56
Hi Chris,
<< Is anyone else finding the quote-eating behaviour of parse(/all!)
rather annoying, too? >>
I was annoyed by it at first, but then I thought about how helpful it is
when parsing most common CSV data formats that quote fields containing
spaces. If I had to choose, I'd keep it like it is (letting it do the hard
work), and handle the other cases myself.
<< Is there any known workaround? >>
If you can take an extra step to process the parsed result, you can add them
back in yourself, though I haven't tested this for validity in all cases. It
is based on the assumption that quotes are used to mark fields containing
spaces in the original data.
repeat i length? items: parse {Carl "Chief REBOL" Sassenrath} none [
if find items/:i " " [
poke items i rejoin [{"} items/:i {"}]
]
]
--Gregg
[4/4] from: chris:langreiter at: 31-Oct-2002 19:55
> I was annoyed by it at first, but then I thought about how helpful it is
> when parsing most common CSV data formats that quote fields containing
> spaces. If I had to choose, I'd keep it like it is (letting it do the hard
> work), and handle the other cases myself.
I would much prefer this behaviour to be switchable.
--c