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

chrisjlee’s picture

+1

mrfelton’s picture

I think you are supposed to use explode for this.

liupascal’s picture

explode 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 ! :-)

mrfelton’s picture

Ah, 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.

IT100’s picture

this 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.

IT100’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jday’s picture

mmm... 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

macsim’s picture

Hi,

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 ?

Stomper’s picture

Will this approach work with an Address Field field in a taxonomy?

Stomper’s picture

How 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