CSV delimiters in SilverStripe

216 views
Skip to first unread message

Jeremy

unread,
Nov 12, 2007, 5:38:58 PM11/12/07
to SilverStripe Development
An interesting bug that came up recently was in the non-standard use
of delimiters for importing/exporting CSV files.

Microsoft Excel 2003 gets its delimiters from the Windows regional
settings. Eg, New Zealand uses commas to delimit and Germany uses semi-
colons.

We've changed the settings back to using commas to fix the bug, but
this raises an implementation issue of how we can keep SilverStripe
internationalised.

Perhaps the delimiter setting could be set on a per-user basis?

Sam Minnee

unread,
Nov 12, 2007, 7:30:30 PM11/12/07
to SilverStripe Development
User-specific import settings would lead to situations where one of
the CMS users couldn't upload a file but the developer trying to
support them can upload a file fine, because of their import
settings. I'm not convinced that it's the best way to go.

For 99% of cases, a site-wide setting would be perfectly adequate -
something set in _config.php. If you wanted to take it further, you
could have a delimter option in the form where you upload the CSV
file.

As a general comment, it would be nice if we could more easily provide
CSV-import functionality at customised places in the system. For
example, a custom app might have a new DataObject that you want to
provide import facilities for.

If we were to make such a field, it would be best to present it in a
pop-up window, so that you could potentially take the user through a
number of steps - choosing the delimiter and maybe even letting the
user match the uploaded columns to the columns in the database. The
point is that if the CSV uploader were in a pop-up, we could more
easily improve on the CSV uploader and then publish that upgrade to
sites that user it.

Sigurd Magnusson

unread,
Nov 12, 2007, 9:03:07 PM11/12/07
to silverst...@googlegroups.com
Excel works nicely in that you select (aka upload in our case) the file, then give the user options having attempted to autodetect more than one comma, tab, or semicolon in each of the top 3 or so lines.
-- 
Thanks,
Sigurd
--

Sigurd Magnusson | Chief Marketing Officer
SilverStripe
http://www.silverstripe.com

Office: +64 4 978 7332
Skype: sigurdmagnusson

Learn more about our next version of the SilverStripe product!
http://silverstripe.com/whats-coming-in-silverstripe-2-2/
Reply all
Reply to author
Forward
0 new messages