Search and Replace multiple characters

View some of the Frequently Asked Questions to our support staff. Included are some tips and tricks making this forum ideal for users getting started with GoAnywhere MFT. Note: Users can reply to existing topics but only our support staff can add new topics to this forum.
1 post Page 1 of 1

Support_Alisa

User avatar
Posts: 13
Joined: Thu Jul 26, 2018 2:03 pm

Post by Support_Alisa » Tue Aug 21, 2018 12:22 pm
Question:

How do I search for and replace multiple characters and strings?

Answer:

The "Search and Replace" task can be a great tool for updating and reformatting files, fixing misspellings, and filtering out unwanted special characters.

The "Search and Replace" task takes an input file and parses the file, searching for the string inputted in the "Search For" field. "Search and Replace" treats the value in the "Search For" field as a single string value.

For example -

Inputting € â into the "Search For" field would search for '€ â'. Search and replace would not do one search for €, followed by another search for â. If you are wanting to search for these two characters separately, you have to leverage two different "Search and Replace" tasks. You would create one "Search and Replace" task for € followed by another "Search and Replace" task for â. In this instance, the input file of the subsequent "Search and Replace" task, will be the output file of the task preceding it. A walk through example of how to create a multitask "Search and Replace" project can be referenced below:

For convenience, set a variable that is equivalent to the directory path you want to be working in.
screenshot1.png
screenshot1.png (20.38 KiB) Viewed 8561 times
Select your "Input File," "Output File," and "Output Files Variable." The "Output Files Variable" will be used as your "Input File" for the next task.
screenshot2.png
"Input File" now contains the file ${dir}/output that has â replaced.
screensho3.png
After running this project, you will have two output files. The first "output" file that has only the â replaced, and output2 which has the final, fully parsed and updated file. If you would like to remove the intermediary output file, you can add a "Delete" task to delete ${currentFile}. This will leave your directory with only the original file and the final output file.
Alisa Bohac
Sr Support Analyst
e. [email protected]
p. 1.800.949.4696
w. HelpSystems.com
1 post Page 1 of 1