Skip to main content
[Command] Append prefix or suffix
Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

The Append prefix or suffix command is used to add text to the beginning and end of an existing string. Common use cases include:

  • Adding file extensions

  • Inserting name prefixes/suffixes

  • Including special start/end characters

  • Formatting strings for applications


Parameter Values

Set parameters

Parameter

Description

Original text

Enter the original text or select a text variable

Operation

Specific how you'd like to append the text

  • Append Prefix: add text to the beginning of a string

  • Append Suffix: add text to the end of a string

Text to append

Enter the text to add to the original text

Save text as

Save the appended text as a new variable

Error handling

Parameter

Definition

When error occurs

Select the action to be performed when an error occurs

  • Terminate the project

  • Ignore the error and execute the next command

  • Retry action


Example

In a web scraping workflow, you may need to alter a URL by add a suffix. The above workflow command will go to the official website of Octoparse, get the URL as webPage, which is https://www.octoparse.com and then use the Append prefix or suffix to add text string "blog" to the bottom of the URL, the final result will be https://www.octoparse.com/blog.

Did this answer your question?