Importing a CSV

9 posts by 3 authors in: Forums > CMS Builder
Last Post: June 3, 2013   (RSS)

By s2smedia - May 30, 2013

when importing a csv, how would I format a "multi selection"  column so it knows its a multi selection content?

By gkornbluth - May 31, 2013

Hi,

I just did an export then import test with a table that has a multi-value list field (check box) that normally pulls it's values from another table (value from the 'num' field and label from the 'title' field).

In this case, although there were three fields exported, (your_field, your_field:value, your_field:label, the only one that gets imported is the your_field field, and the format that the multi value checkbox required was the record numbers from the 'num' field, with no comma or other separator. so if the values required were to check the box corresponding to record 1, 2 and 4, the import field contained 124

When using a standard multi-value list field (check box) with option 1 , option 2 and option 3 choices, if the first and third option were selected, the required format for the import was option 1option 3

Hope that helps.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By s2smedia - May 31, 2013

hmm ... that doesnt seem to be exporting.

See attached.. this is how it shows when I export.

The last column is the mutli selection check box data.. you will see items with no slection show as NULL... items with selects show with just spaces between them.

but if I try to add one to end.. and import.. it reads what I have in that field as 1 long checkbox selection 

 Flatware Holloware Buffet Accessories Service Carts

By gkornbluth - May 31, 2013

I've attached an all records export csv so you can compare

The 2 fields described are in the export

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By s2smedia - June 3, 2013

i am exporting/importing using phpmysql dashboard. my CMS export plugin does not work. I tried using commas doing it the way im doing it.. and not working

By gkornbluth - June 3, 2013

Hi Greg,

I'm a bit confused, because that's not what I found when I exported my test section using csv export, or what was imported correctly using csv import.

In the .csv I attached to my post above, take a look at column N (a multi value check box list field getting it's values from the num and title fields in another database) and column X (a standard multi value check box list field (using option one, option two, and option three).

There appear to be no spaces (or tabs) between any of those values.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gregThomas - June 3, 2013

Hi Jerry,

Are you viewing the CSV in Excel/Open or Libre Office? As these programs seem to remove the tab spacing when you view a CSV in them, for example in the example CSV you provided the text is:

" 1 2 ",

But it's appearing as 12 when the file is viewed in Libre office, the same thing is happening for column X as well. 

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By gkornbluth - June 3, 2013 - edited: June 3, 2013

Greg,

Thanks for the education.

I forgot that Excel was created by Microsoft and that Microsoft marches to its own drummer.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php