---
sourceDocument: Australia ServiceNow AI Platform Capabilities
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/servicenow-platform

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# File Replace String activity

# File Replace String activity {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

The File Replace String activity finds and replaces a string in a file on a Linux or UNIX computer.
This activity replaces an SSH activity by the same name available
in releases prior to Istanbul. If you have a workflow created in a previous version that
uses the deprecated activity, your workflow will continue to work normally after upgrading
to Istanbul. However, all new workflows must use the custom version of this activity. This
activity was built with the [SSH activity template](https://servicenow-prod.fluidtopics.net/8fPnC2A~dq4pdTWS848KCA#t_CreateAnSSHActivity "Create an activity that extracts data from a target host that uses the SSH network protocol."), which gives workflow administrators the ability to store
input and output variables in the [databus](https://servicenow-prod.fluidtopics.net/8OYaonyVEUHUlQE7wAXD_w#t_ReuseDataInTheActivityDesigner "The Data tab in the Workflow Editor lists all custom activities used in the current workflow that produce data and displays that data for reuse in other custom activities.").{#r_FileReplaceStringActivity__p_ExplainDeprecation}

## Input variables

{#r_FileReplaceStringActivity__table_dpc_r5z_zp__entry__2}

| Variable | Description |
|-|-|
| hostname | Hostname or IP address of destination server for SSH activity. |
| directory | Name of the working (target) directory. |
| file | Name of the file in which the string is to be replaced. |
| find_pattern | A regular expression of the text to replace. |
| replace_string | The replacement string for the text found by the expression in the find_pattern variable. |
| options | Replacement options: * first: Replaces the first occurence of the pattern. * all: Replaces all occurrences of the pattern. {#r_FileReplaceStringActivity__ul_fxk_4mk_pw} |
[Tabelle : 1. File Replace String input variables]

{#r_FileReplaceStringActivity__table_dpc_r5z_zp}

## Output variables

{#r_FileReplaceStringActivity__table_ufj_vmk_pw__entry__2}

| Variable | Description |
|-|-|
| return_code | Indicates whether or not the string was replaced successfully in the target file. |
| error_message | Message that indicates if an error has occurred. Any value other than 0 indicates a failure. |
[Tabelle : 2. File Replace String output variables]

{#r_FileReplaceStringActivity__table_ufj_vmk_pw}

## Conditions

{#r_FileReplaceStringActivity__table_bfc_xmk_pw__entry__2}

| Condition | Description |
|-|-|
| Success | The activity has successfully replaced the string in the file. |
| Failure | The activity has failed to replaced the string in the file. |
[Tabelle : 3. File Replace String conditions]

{#r_FileReplaceStringActivity__table_bfc_xmk_pw}

