replace-values-in-list

Description

replace-values-in-list adaptor replaces specified values in a list using either text or regular expression.

Use the import-list-from-text-file adaptor to upload an existing text file, or connect to any other adaptor that outputs a list.

The text matching function is not case-sensitive, use the regular expression option if you need to specify case-sensitivity.

Inputs

list Type: list Required: Yes The list of text values.

pattern Type: text Required: Yes The text or regular expression to be replaced. The pattern is treated as a regular expression if it begins and ends with / (e.g., /.*/).

replacement Type: text Required: No The text that replaces all instances of the pattern. If unspecified, matches will be replaced with blank text. If a regular expression was used as a pattern, capture groups can be included as $1, $2, etc.

Outputs

list Type: list The list of modified elements

Examples

Example 1: Default behaviour.

Inputs:

list:

  1. green

  2. blue

  3. red

  4. yellow

pattern: yellow

replacement: brown

Outputs:

list:

  1. green

  2. blue

  3. red

  4. brown

-> Replace the value yellow in the list with the new value brown.

Last updated