Limit Migrate explode process plugin to 1 takes whole string I have a csv places column with values like that:

Madrid|Spain
Barcelona|Spain


I want to migrate this places to a custom taxonomy and 3 terms (Madrid, Spain, Barcelona) get generated doing it like that:

  field_taxonomy_places:
    -
      plugin: explode
      source: places
      delimiter: '|'
    -
      plugin: entity_generate


But actually I only want to create cities (Madrid, Barcelona), but not countries. So I try to take the first value till the delimiter like that:

field_taxonomy_places:
    -
      plugin: explode
      source: places
      limit: 1
      delimiter: '|'
    -
      plugin: entity_generate


The problem is that now 2 terms get generated (Madrid|Spain, Barcelona|Spain).
Just found the solution after rereading the PHP explode docs:


  If limit is set and positive, the returned array will contain a
  maximum of limit elements with the last element containing the rest of
  string.


So setting the limit to 1 has the effect that the returned array element contains the rest of the string, which in my case is the whole string. So setting the limit to 2 fixes the problem and gives back the first part of the string:

field_taxonomy_places:
    -
      plugin: explode
      source: places
      limit: 2
      delimiter: '|'
    -
      plugin: entity_generate