Closed (fixed)
Project:
Feeds Tamper
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jul 2011 at 08:20 UTC
Updated:
29 Oct 2013 at 02:23 UTC
Hi!
i have csv with the next structure:
Address1|Address2|Address3|City
how can i merge all addresses in one multivalue node field?
thanks
Comments
Comment #1
chrisjlee commented+1
Comment #2
mrfelton commentedI think you are supposed to use explode for this.
Comment #3
liupascal commentedexplode allows to have multiple value within a csv column to be imported in a multiple value field - i am not sure it will work here, as it is needed to "merge" csv columns.
If it's doable with explode, i'd like to know how ! :-)
Comment #4
mrfelton commentedAh, I misunderstood.
I've done this, but only with 2 columns that needed to be merged into one. I set up one of the columns to map to the 'temporary column 1' field (can't remember the exact name, but something like that - its something that feeds provides, presumable for purposes like this). The, I set up another mapping for the second column to map to the final destination field, and on that I added a rewrite tamper, using tokens to rewrite into the format [field1],[field2] - and then used explode on that to split the values into multiple values for the one multivalue field.
Hope that makes sense.
Comment #5
IT100 commentedthis works.
Here's an other example for merging three csv columns to one term reference, (Autocomplete Deluxe field in my case).
In mapping for Node processor part of feeds importer:
source -> Target
csv_field1 -> Temporary target 1
csv_field2 -> Temporary target 1
csv_field3 -> Target_field
Configure Feeds Tamper:
go to csv_field3:
add a rewrite plugin and select from patterns the required fields, separating them with a comma.
[csv_field1],[csv_field2],[csv_field3]
then add the explode plugin under need
Import csv,
enjoy.
Reconfigure to use 2 fields, or more.
Comment #6
IT100 commentedComment #8
jday commentedmmm... this worked great except that the replacement patterns did not get de-tokenized. So rather than the values from the csv file, I have [primary-email] and [secondary-email] in my multi-value email field.
Does this not work with email fields or did I miss something...
Update: Solution is here: http://drupal.org/node/1246592#comment-4913380
Comment #9
macsim commentedHi,
I have 3 columns in my csv that I need to import into a multivalue field collection's field, but I first need to alter the values from String to Unix timestamp.
I tried to use #5 like :
csv_column1 => Temporary target 1
csv_column2 => Temporary target 1
csv_column3 => Target_field
And in Feeds Tamper configuration I put
csv_column1 => String to Unix timestamp
csv_column2 => String to Unix timestamp
csv_column3 => String to Unix timestamp + Rewrite : [csv_column1],[csv_column2],[csv_column3] + Explode
But that doesn't work as expected... Does someone know how to achieve that ?
Comment #10
Stomper commentedWill this approach work with an Address Field field in a taxonomy?
Comment #11
Stomper commentedHow would one map and format individual [street address], [city], [state], [zipcode] CSV rows/columns to an Address Field in a taxonomy?
To this = Address field: [street address], [city], [state], [zipcode]
Thanks