CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing comma separated values/ columns
Pages: [1]

Author Topic: Importing comma separated values/ columns  (Read 1144 times)

Gregorio

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: using 3.4 demo
  • CMS version: joomla 1.5
  • MySQL version: Mysql v.5.0.83
  • PHP version: PHP v. 5.2.9
Importing comma separated values/ columns
October 18, 2011, 04:26:26 am
Hi there,

I have been using Wufoo to store contact data information. When exporting contact data from Wufoo, multiple choice values are structured in columns. However, if you want to import to CiviCRM multiple choice values they must be separated by commas under the same column.

Please find attached an example.

Is there anyway to sort this out? Any suggestion? I have some thousands of records with some multiple choice values fields  to import to CiviCRM.
Thanks in advance for any help!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing comma separated values/ columns
October 18, 2011, 06:03:46 am

The easiest thing to do would be to use a spreadsheet (or a small script) to combine all the multiple-choice values in one column

alternatively you can try to modify the civicrm import code, but that would be a LOT LOT more involved, IMO

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Importing comma separated values/ columns
November 09, 2011, 12:07:30 pm
Gregorio:
In Excel or LibreOffice, assuming those values are in columns A through E, you can put in column F (or wherever):
=A2 & "," & B2 & "," & C2 & "," & D2 & "," & E2

Of course, that assumes that each row has five favorite colors.  A more complicated version that addresses that is:
=if(len(a2) > 0; A2;) & if(len(b2) > 0; ',' & b2;) & if(len(c2) > 0; ',' & c2;) ...and so on.  Note that I used semicolons to separate my "if" fields - YMMV based on whether you're using Excel or LibreOffice/OpenOffice.
 
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing comma separated values/ columns

This forum was archived on 2017-11-26.