Closed (duplicate)
Project:
TableField
Version:
7.x-2.0
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2012 at 22:37 UTC
Updated:
27 Jul 2013 at 17:57 UTC
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
Comment #0.0
Bernsch commentedtext change
Comment #1
shevchess commentedHi 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.
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.
Comment #2
Bernsch commented@Dmitriy Ivanov: Thanks for the tip!
Comment #3
Bernsch commentedHere is a patch and ist was commited to version 2.2
#2048279: Add a user configurable CSV separator
Comment #3.0
Bernsch commentedtext change