Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i want to import large list of updated products sku.
now, the existing list looks like: 001-002-003
new products sku list looks like: 001-002-003-004
so, to import correctly, i must remove the last block in sku (-004).
so, my question is: can i, first, explode field value (separator "-", limit 3) and after that, implode the resulted value?
or that is the same, perform new action on results of previous action?
thanks.
Comments
Comment #1
twistor CreditAttribution: twistor commentedExploding with a limit 3 will give you an array('001', '002', '003-004').
Why don't you try the regex find replace plugin?
Find:
/^(.*)-\d+$/
Replace:
$1
Comment #2
twistor CreditAttribution: twistor commented