Hy. I have a table field with 9 column and 14 rows.
When i am import a csv file the results is 1 column an 14 rows and shows:
1;Team-1;22;12;6;4;61;32;42
2;Team-2;22;11;5;4;51;34;41
3;Team-3;22;10;5;5;55;31;39
4;Team-4;22;10;6;6;44;32;35
.
.
.
14;Team-14;22;4;6;12;21;52;18

The CSV-file is from MS Excel 2010

Comments

Bernsch’s picture

Issue summary: View changes

text change

shevchess’s picture

Hi Bernsch,
actually it's not a bug. You just import the CSV file with semicolon delimited, not a comma as usual.
The module doesn't recognize CSV files with semicolon as separator. That's why you get only one column.

The field delimiter is set to "," in the function fgetcsv() in the module.

$csv = fgetcsv($handle, 0, ",");

Possible solutions:
1) Not good way. Just change the field delimiter in the function fgetcsv() to ";". See http://drupal.org/node/949870. But in this case you will get one column when trying to import a CSV file with commas delimited.

2) The right way. Create a patch to add a new setting in the "Import from CSV" fieldset where a user can specify the field delimiter for CSV file which he will import. In this case we can use any delimiter.

Bernsch’s picture

Component: Code » User interface
Category: bug » feature
Status: Active » Needs work

@Dmitriy Ivanov: Thanks for the tip!

  • Solution one works finde.
  • Solution two - i need work ;-)
Bernsch’s picture

Status: Needs work » Closed (duplicate)

Here is a patch and ist was commited to version 2.2
#2048279: Add a user configurable CSV separator

Bernsch’s picture

Issue summary: View changes

text change