[REBOL] Re: quotes gone
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