> > - an option to define fields in the table where the delimiter is
> > ignored (like "one,two" would be treated as one column):  This would
> > allow free text fields in the table or merge columns.
>
> Actually, I'm not exactly sure how to do this, though admittedly it's
> a good idea.  Is there a standard for CSV files?  I've though of
> changing how a row is saved, by listing the form fields for each
> column and then adding " " if needed, or escaping the ',' which would
> be easier. But then you might have compatibility problems if using the
> csv file elsewhere.
>
> On the other hand, the problem with " , " is that I can't run the
> simple explode() function to get the columns. It's not regex function.

This could be preg_split instead of explode, first for the headers,
then for each row. But maybe this will be a question of speed and
performance.
preg_split would allow a regex, like split at $delimiter if $delimiter
is not enclosed in " ".

$data['headers'] = explode(',', $data['rows'][0]);
                foreach ($data['rows'] as $i => $ii) {
                        if ($i == 0) continue;
                        $cols = explode(',', $ii);
                        foreach ($cols as $c => $cc) $data[$i][$c] = $cc;
                        }

Greetings, Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to