searchAndReplaceFile Step

Last published at: July 27th, 2024

Description:

Search and replace file contents.

Inputs

  • inputFilePath– Input file path
  • outputFilePath – Output file path
  • mappingString – Mapping of search and replace strings 

Returns

  • True – step executed successfully
  • False – step failed to execute 

Usage:

Example:

Let’s build and execute the searchAndReplaceFileDef example.          

  • Create a new definition called “searchAndReplaceFileDef
  • Select the definition and click the “design” button
  • Drag a searchAndReplaceFile step from the toolbox
  • Connect the dots between the start and searchAndReplaceFile step 

  • Click on the “searchAndReplaceFile” step to configure its properties
  • Configure the following values for the properties as shown on the below graphic
  • In the Mappings of search and replace strings, put the word to be searched and replaced as shown below and save.

  • Save the workflow definition, create a workflow instance and execute. Step should search and replace file contents and creates new file.