I need to replace a string with a variable

Hi all,

This is my process:

  1. if a condition is met
  2. variable1 is created
  3. read a text file
  4. i get the full content of the text file and save it in a new variable
  5. replace the character ] with variable1
  6. delete the original file
  7. re-create the same file with my amendment

Everything works, but step 4.

Here the screenshot: what is the correct formula?

thank you :slight_smile:

Hi @andrea.venturino

Try the below syntax:

copyofentire= copyofentirefile.Replace("]", newemailanduser)

Since newemailanduser is variable have above. So remove the double quotes

Regards

Hi @andrea.venturino

Try the below syntax:

copyofentire= copyofentirefile.Replace("]", newemailanduser)

Remove the double quotes that you have kept of newemailanduser

Regards

1 Like

Hi @Parvathy,
Thank you!

1 Like

You’re welcome @andrea.venturino

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.