Opened 10 years ago

Closed 10 years ago

#9701 closed enhancement (fixed)

More flexible separators in CsvStore

Reported by: okilele Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.4
Component: DojoX Data Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Eugene Lazutkin)

Dojo CsvStore don't recognize other fixed separator than comma, but In Europe comma is used to separate decimals. I suggest that CsvStore accept others charaters separtors and this separators will be a parameter of CsvStore.

Attachments (4)

CsvStore.patch (1.1 KB) - added by Jared Jurkiewicz 10 years ago.
Potential patch for request.
tarifach.csv (438 bytes) - added by okilele 10 years ago.
file with semicolon like fields separator ";" and coma "," like decimals separator.
tarifach0.csv (182 bytes) - added by okilele 10 years ago.
other fields separator pipe "|" and coma like decimals separator
CsvStore_separators.patch (7.2 KB) - added by Jared Jurkiewicz 10 years ago.
Patch that adds support for defining the separator (comma is default), for the data separator

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by Eugene Lazutkin

Description: modified (diff)
Type: defectenhancement

Sounds reasonable to me to have a flexible separator symbol.

comment:2 Changed 10 years ago by Jared Jurkiewicz

Can you provide files where the separator is different for testcases?

The change should be trivial to the store, but no change will go in without a testcase.

Changed 10 years ago by Jared Jurkiewicz

Attachment: CsvStore.patch added

Potential patch for request.

Changed 10 years ago by okilele

Attachment: tarifach.csv added

file with semicolon like fields separator ";" and coma "," like decimals separator.

Changed 10 years ago by okilele

Attachment: tarifach0.csv added

other fields separator pipe "|" and coma like decimals separator

comment:3 in reply to:  2 Changed 10 years ago by okilele

Replying to jaredj:

Can you provide files where the separator is different for testcases?

The change should be trivial to the store, but no change will go in without a testcase.

Yes I added two files tarifach.csv and tarifach0.csv. The first with semicolon like fields separator and coma like decimals separator, the second file with pipe like fields separator and coma like decimals separator. In your attention, now I don't protect my decimals coma with quote because separator is indicate. Are you agree ?

comment:4 Changed 10 years ago by Jared Jurkiewicz

When the separator is comma, you have to wrap any fields that use commans within it with "". The same is true for any separator you might use. If it appears within the data of a field, the field should be quoted.

Changed 10 years ago by Jared Jurkiewicz

Attachment: CsvStore_separators.patch added

Patch that adds support for defining the separator (comma is default), for the data separator

comment:5 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbd1.4

comment:6 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [19807]) Adding in support for changing the separator used for the fields in the file. \!strict fixes #9701

Note: See TracTickets for help on using tickets.