I needed to apply a big mapping of 111 values with Find & Replace. I found it useful to have a single tamper that gets a list of all replacements. This patch is not yet good to be committed, needs to be tested and improved, but might be helpful to some people.

Files: 
CommentFileSizeAuthor
feeds_tamper-multiple_replace.patch1.6 KBfranz

Comments

Status:Needs review» Reviewed & tested by the community

Patch above worked perfectly for me. Thanks!

Status:Reviewed & tested by the community» Needs work

So after further testing I ran into a problem. I'm using this tamper on a CSV user import, mapping values from several columns onto a taxonomy field, like this:

  1. A Rewrite tamper to pull values from the 24 preceding columns and this one into a single string, comma separated.
  2. This Find and replace multiple tamper, to replace deprecated term names with newer ones in the string. I do this here as opposed to after the Explode because some old terms map to two new ones. (i.e. "term,term,this-one,term" becomes "term,term,that,one,term")
  3. An Explode tamper on commas.
  4. A Unique tamper, in case the find and replace created duplicates.

As expected, the new users get the updated taxonomy terms. However, terms matching the "source" half of the find & replace multiple pairs are being created too. Haven't had the time to track this down, and it's a one-time import so I can deal with just deleting those extra terms, but this feature isn't quite ready.

How to stop replacing after first replace.
If i have in list

Beauty|Health and Beauty
Health|Health and Beauty

The result is

Health and Beauty and Beauty.

That seems out of scope for current implementation. Why don't you try:

Beauty|_TEMPORARY1_
Health|Health and Beauty
_TEMPORARY1_|Health and Beauty

A bit skechy, but I think it works.

Hi,
after update feeds and feed tamper modules this was stopped working

I've got this error when i try to edit find_replace_multiple into UI

Fatal error: Function name must be a string in ..\sites\all\modules\feeds_tamper\feeds_tamper_ui\feeds_tamper_ui.admin.inc on line 459

And

Fatal error: Function name must be a string in ..\sites\all\modules\feeds_tamper\feeds_tamper.module on line 68

when 9 try to import